hudson.util.jna
Interface GNUCLibrary

All Superinterfaces:
com.sun.jna.Library

public interface GNUCLibrary
extends com.sun.jna.Library

GNU C library.

Not available on all platforms (such as Linux/PPC, IBM mainframe, etc.), so the caller should recover gracefully in case of LinkageError. See HUDSON-4820.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sun.jna.Library
com.sun.jna.Library.Handler
 
Field Summary
static int F_GETFD
           
static int F_SETFD
           
static int FD_CLOEXEC
           
static GNUCLibrary LIBC
           
 
Fields inherited from interface com.sun.jna.Library
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
 
Method Summary
 int chdir(String dir)
           
 int chmod(String fileName, int i)
           
 int chown(String fileName, int uid, int gid)
           
 int close(int fd)
           
 int dup(int old)
           
 int dup2(int old, int _new)
           
 int execv(String file, com.sun.jna.StringArray args)
           
 int fcntl(int fd, int command)
           
 int fcntl(int fd, int command, int flags)
           
 int fork()
           
 int getdtablesize()
           
 int getegid()
           
 int geteuid()
           
 int getpid()
           
 int getppid()
           
 org.jvnet.libpam.impl.CLibrary.passwd getpwuid(int uid)
           
 int kill(int pid, int signum)
           
 void perror(String msg)
           
 int readlink(String filename, com.sun.jna.Memory buffer, com.sun.jna.NativeLong size)
          Read a symlink.
 int rename(String oldname, String newname)
           
 int setenv(String name, String value, int replace)
           
 int setsid()
           
 String strerror(int errno)
           
 int symlink(String oldname, String newname)
          Creates a symlink.
 int sysctl(int[] mib, int nameLen, com.sun.jna.Pointer oldp, com.sun.jna.ptr.IntByReference oldlenp, com.sun.jna.Pointer newp, com.sun.jna.ptr.IntByReference newlen)
           
 int sysctlbyname(String name, com.sun.jna.Pointer oldp, com.sun.jna.ptr.IntByReference oldlenp, com.sun.jna.Pointer newp, com.sun.jna.ptr.IntByReference newlen)
           
 int sysctlnametomib(String name, com.sun.jna.Pointer mibp, com.sun.jna.ptr.IntByReference size)
           
 int umask(int mask)
           
 int unsetenv(String name)
           
 

Field Detail

F_GETFD

static final int F_GETFD
See Also:
Constant Field Values

F_SETFD

static final int F_SETFD
See Also:
Constant Field Values

FD_CLOEXEC

static final int FD_CLOEXEC
See Also:
Constant Field Values

LIBC

static final GNUCLibrary LIBC
Method Detail

fork

int fork()

kill

int kill(int pid,
         int signum)

setsid

int setsid()

umask

int umask(int mask)

getpid

int getpid()

geteuid

int geteuid()

getegid

int getegid()

getppid

int getppid()

chdir

int chdir(String dir)

getdtablesize

int getdtablesize()

execv

int execv(String file,
          com.sun.jna.StringArray args)

setenv

int setenv(String name,
           String value,
           int replace)

unsetenv

int unsetenv(String name)

perror

void perror(String msg)

strerror

String strerror(int errno)

getpwuid

org.jvnet.libpam.impl.CLibrary.passwd getpwuid(int uid)

fcntl

int fcntl(int fd,
          int command)

fcntl

int fcntl(int fd,
          int command,
          int flags)

chown

int chown(String fileName,
          int uid,
          int gid)

chmod

int chmod(String fileName,
          int i)

dup

int dup(int old)

dup2

int dup2(int old,
         int _new)

close

int close(int fd)

rename

int rename(String oldname,
           String newname)

sysctlbyname

int sysctlbyname(String name,
                 com.sun.jna.Pointer oldp,
                 com.sun.jna.ptr.IntByReference oldlenp,
                 com.sun.jna.Pointer newp,
                 com.sun.jna.ptr.IntByReference newlen)

sysctl

int sysctl(int[] mib,
           int nameLen,
           com.sun.jna.Pointer oldp,
           com.sun.jna.ptr.IntByReference oldlenp,
           com.sun.jna.Pointer newp,
           com.sun.jna.ptr.IntByReference newlen)

sysctlnametomib

int sysctlnametomib(String name,
                    com.sun.jna.Pointer mibp,
                    com.sun.jna.ptr.IntByReference size)

symlink

int symlink(String oldname,
            String newname)
Creates a symlink. See http://linux.die.net/man/3/symlink


readlink

int readlink(String filename,
             com.sun.jna.Memory buffer,
             com.sun.jna.NativeLong size)
Read a symlink. The name will be copied into the specified memory, and returns the number of bytes copied. The string is not null-terminated.

Returns:
if the return value equals size, the caller needs to retry with a bigger buffer. If -1, error.


Copyright © 2004-2013. All Rights Reserved.