Mono.Posix [00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 79 15 99 77 D2 D0 3A 8E 6B EA 7A 2E 74 E8 D1 AF CC 93 E8 85 19 74 95 2B B4 80 A1 2C 91 34 47 4D 04 06 24 47 C3 7E 0E 68 C0 80 53 6F CF 3C 3F BE 2F F9 C9 79 CE 99 84 75 E5 06 E8 CE 82 DD 5B 0F 35 0D C1 0E 93 BF 2E EE CF 87 4B 24 77 0C 50 81 DB EA 74 47 FD DA FA 27 7B 22 DE 47 D6 FF EA 44 96 74 A4 F9 FC CF 84 D1 50 69 08 93 80 28 4D BD D3 5F 46 CD FF 12 A1 BD 78 E4 EF 00 65 D0 16 DF] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. System.Object System.CLSCompliant(false) System.Obsolete("Use Mono.Unix.Native.Syscall.") The Syscall wrapper class makes it possible to execute the defined system calls. For more information on any of these system calls, the linux manual system (man) has exhaustive information on each syscall in section two: 'man 2 chdir' (or often 'man chdir(2)') for example would give information related to chdir, including error codes, which are in general not listed here.

This type is obsolete. Please use instead.

The syscall wrapper follows the posix standard. This means some functionality or flags which are linux specific may not be available. Below is a list of known posix syscall functions and features that are not yet implemented.

Syscall featuer
Status
OpenFlags.O_NOFOLLOW = 512
Non posix. Not yet implemented.
OpenFlags.O_DIRECTORY = 1024
Non posix. Not yet implemented.
OpenFlags.O_DIRECT = 2048
Non posix. Not yet implemented.
OpenFlags.O_ASYNC = 4096
Non posix. Not yet implemented.
OpenFlags.O_LARGEFILE = 8192
Non posix. Not yet implemented.
Signals.SIGPWR
Not yet implemented.
Signals.SIGRTMIN
Not yet implemented.
execve
Not yet implemented.
time
Not yet implemented.
mknod
Not yet implemented.
mount
Not yet implemented.
umount
Not yet implemented.
stime
Not yet implemented.
ptrace
Not yet implemented.
utime
Not yet implemented.
ftime
Not yet implemented.
pipe
Not yet implemented.
times
Not yet implemented.
fcntl
Not yet implemented.
ulimit
Not yet implemented.
sigaction
Not yet implemented.
sigsuspend
Not yet implemented.
sigpending
Not yet implemented.
setrlimit
Not yet implemented.
getrlimit
Not yet implemented.
getrusage
Not yet implemented.
gettimeofday
Not yet implemented.
settimeofday
Not yet implemented.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  No need to call directly. Class only contains static functions.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Checks whether the calling task has the necessary access rights to perform operations specified by mode on the file pathname. AccessMode is a mask consisting of one or more of the values R_OK, W_OK, X_OK and F_OK which respectively test if the taks can read, write, execute or test if the file exists. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

  The test is performed using the real uid and gid of the calling task. Only the access bits of the file are tested. See 'man access(2)' for more information and error codes.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt32 `` a If the call completes successfully, the taks will receive a SIGALARM signal after a delay of seconds seconds. A delay of zero seconds simply cancel the alarm. If an previous alarm was activated when the call is made then the previous alarm is cancelled. a . If a previous alarm was activated, the call returns the time delay before the expiration of that previous alarm (now canceled). Otherwise, it returns zero.

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Changes the current directory to 'path'. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

  See 'man chrdir(2)' for more information and error codes.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Change permissions for a file or folder. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

  See 'man chmod(2)' for error codes and more information.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` a a representing owner UID. a representing Group GID Change owner for a file or folder. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

  The owner of the file specified by path is changed. Only the super-user may change the owner of a file. The owner of a file may change the group of the file to any group of which that owner is a member. The super-user may change the group arbitrarily. See 'man chown(2)' for more information and error codes.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a representing new root directory. Change root directory a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

  See 'man chroot(2)' for more information and error codes.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Closes the file descriptor fileDescriptor. If fileDescriptor is the last file descriptor refering to a file, then the ressources associated with that file are deallocated. The lock held on the file by the current task are released. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Closes the directory represented by IntPtr. IntPtr is a pointer retrieved by opendir() a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Creates a file 'pathname' using the given file mode flags. a

  This member is obsolete. Please use instead.

  On success, a file descriptor for the file is returned. This file descriptor is the lowest numbered unused descriptor. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a dup duplicates a file descriptor to the lowest unused file descriptor available. a

  This member is obsolete. Please use instead.

  On success, the new file descriptor is returned. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a dup2 duplicates a file descriptor to another specified file descriptor. If the destination file descriptor is already used, it is closed. The two descriptors share all (ie. file locks, position, etc.) but the close-on-exec flag. a

  This member is obsolete. Please use instead.

  On success, the new file descriptor is returned. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Terminates the process that calls the function with the status 'status'. a

  This member is obsolete. Please use instead.

  `using System; using Mono.Posix; using System.Runtime.InteropServices; class Test { public void SignalCatcher(int v) { // sleep signal caught. Console.WriteLine("Signal received: " + v); // this line will not be printed because process exits... Console.WriteLine("Exiting with: " + Syscall.exit(9)); } public static void Main(string[] args) { Test t = new Test(); Console.Write("waiting for event..."); string x = Console.ReadLine(); } public Test() { // create a signal handler delegate for sleep signals Console.WriteLine("signal result: " + Syscall.signal(14, new Syscall.sighandler_t(SignalCatcher))); // send a sleep signal Syscall.alarm(3); } }`
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 fork() turns a single process into 2 identical processes, known as the parent and the child. a

  This member is obsolete. Please use instead.

  On success, fork() returns 0 to the child process and returns the process ID of the child process to the parent process. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Get the effective group ID for the current process. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Get the effective user ID for the current process. a

  This member is obsolete. Please use instead.

  To be added

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Get the group ID for the current process. a

  This member is obsolete. Please use instead.

  To be added

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` a Retrieve the groupname for the given GID. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String Retrieves the hostname. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Get the process group. a

  This member is obsolete. Please use instead.

  getpgrp always returns the current process group. see 'man getpgrp(2)' for more information.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Returns the unique identifier for the current process. a

  This member is obsolete. Please use instead.

  often used to generate temp. file names etc.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Returns the unique identifier for the parent process. a

  This member is obsolete. Please use instead.

  To be added

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Get the user ID for the current process. a

  This member is obsolete. Please use instead.

  To be added

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` a Retrieves the username for the UID in question. a

  This member is obsolete. Please use instead.

  `public static void Main(string[] args) { const int ROOT = 0; Test t = new Test(); Console.Write("Hello, " + Syscall.getusername(ROOT)); string x = Console.ReadLine(); }`
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` a Boolean value indicating if the file at fileDescriptor is a tty. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` `` a a Kill the process 'pid' with the given signal.

  This member is obsolete. Please use instead.

  `int myPID = Syscall.getpid(); Syscall.kill(myPID,9);`
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` a a Owner UID a Owner GID Change the ownership for 'path' a

  This member is obsolete. Please use instead.

  The owner of the file specified by path is changed. Only the super-user may change the owner of a file. The owner of a file may change the group of the file to any group of which that owner is a member. The super-user may change the group arbitrarily. See 'man chown(2)' for more information and error codes.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Create a hard link from oldPath to newPath. a

  This member is obsolete. Please use instead.

  There is no way to distinguish the links. On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` a a a Changes the read/write file offset of a file descriptor. a

  This member is obsolete. Please use instead.

  The offset parameter is interpreted according to the possible following values of whence:

  Value
  Description
  SEEK_SET
  the new file offset will be the current offset plus offset.
  SEEK_CUR
  the new file offset will be offset.
  SEEK_END
  the new file offset will be the end of the file plus offset. If we seek past the end of a file, the new file region contains 0.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Retrieves via output paramter the file status struct for a file. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Create a directory at 'path' with the given FileMode. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Change the priority of the current process by given increment. a . On success, zero is returned. On error, -1 is returned and .GetLastWin32Error is set.

  This member is obsolete. Please use instead.

  Adds 'increment' to the priority of the calling task. Only a task with superuser privileges may specify a negative inc.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Creates/opens a file 'pathname' using the given file open flags. a

  This member is obsolete. Please use instead.

  On success, a file descriptor for the file is returned. This file descriptor is the lowest numbered unused descriptor. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` a a a Creates/opens a file 'pathname' using the given open and file mode flags. a

  This member is obsolete. Please use instead.

  On success, a file descriptor for the file is returned. This file descriptor is the lowest numbered unused descriptor. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IntPtr `` a Opens a directory at 'path'. a

  This member is obsolete. Please use instead.

  `public static void Main(string[] argv) { IntPtr dir = Syscall.opendir("/tmp"); string nextentry = Syscall.readdir(dir); while(nextentry!=null) { Console.WriteLine(nextentry); nextentry = Syscall.readdir(dir); } }`
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Pause the current process. The task sleeps until a signal is received. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IntPtr `` `` `` a a a Reads up to count bytes into buf from fileDescriptor. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` a Read entry from a directory IntPtr as string. a

  This member is obsolete. Please use instead.

  `public static void Main(string[] argv) { IntPtr dir = Syscall.opendir("/tmp"); string nextentry = Syscall.readdir(dir); while(nextentry!=null) { Console.WriteLine(nextentry); nextentry = Syscall.readdir(dir); } }` See also opendir()
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` a Gets the destination of a symlink as a string. See also read() a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Rename oldPath to newPath. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Removes the directory at 'path'. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Sets the group ID for the current process to 'gid'. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Sets the process group ID for the current process to 'pgid'. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Sets the real and effective group ID for the current process to 'rgid' and 'egid' respectively. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Sets the real and effective user ID for the current process to 'ruid' and 'euid' respectively. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 Creates a session and sets the process group ID. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Sets the user ID for the current process to 'uid'. a

  This member is obsolete. Please use instead.

  often used to generate temp. file names etc.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a . The signal() function returns the previous value of the signal handler, or SIG_ERR on error and .GetLastWin32Error is set. a Register a handler for a given posix signal. a

  This member is obsolete. Please use instead.

  See 'man signal(2)' and 'man signal(7)' for more information and error codes.

  `/* Possible signal values list: Signal Value Action Comment ----------------------------------------------------------------------- SIGHUP 1 Term Hangup detected on controlling terminal or death of controlling process SIGINT 2 Term Interrupt from keyboard SIGQUIT 3 Core Quit from keyboard SIGILL 4 Core Illegal Instruction SIGABRT 6 Core Abort signal from abort(3) SIGFPE 8 Core Floating point exception SIGKILL 9 Term Kill signal SIGSEGV 11 Core Invalid memory reference SIGPIPE 13 Term Broken pipe: write to pipe with no readers SIGALRM 14 Term Timer signal from alarm(2) SIGTERM 15 Term Termination signal SIGUSR1 30,10,16 Term User-defined signal 1 SIGUSR2 31,12,17 Term User-defined signal 2 SIGCHLD 20,17,18 Ign Child stopped or terminated SIGCONT 19,18,25 Continue if stopped SIGSTOP 17,19,23 Stop Stop process SIGTSTP 18,20,24 Stop Stop typed at tty SIGTTIN 21,21,26 Stop tty input for background process SIGTTOU 22,22,27 Stop tty output for background process */ using System; using Mono.Posix; using System.Runtime.InteropServices; class Test { public void SignalCatcher(int v) { Console.WriteLine("Signal received: " + v); } public static void Main(string[] args) { Test t = new Test(); Console.Write("waiting for event..."); string x = Console.ReadLine(); } public Test() { Console.WriteLine("signal result: " + Syscall.signal(14, new Syscall.sighandler_t(SignalCatcher))); Syscall.alarm(3); } }`
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Retrieves via output paramter the file status struct for a file. a

  This member is obsolete. Please use instead.

  see also lstat()

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` a Get error message string for 'errnum'. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a Create a soft link from oldPath to newPath. a

  This member is obsolete. Please use instead.

  See also: link().

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void sync forces "dirty" (modified) filesystem buffers to be written to disk.

  This member is obsolete. Please use instead.

  The filesystem buffer cache is generally write-behind, for best performance. But since the cache is not persistent, it should be flushed periodically. A sync() call is issued by the update daemon periodically.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Sets new umask. a

  This member is obsolete. Please use instead.

  Returns previous umask value.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a Deletes a link to a file. a

  This member is obsolete. Please use instead.

  If the file is not used and it was the last link, the file is also deleted.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` a a waitpid() will force a parent process to wait for a child process to stop or terminate. a

  This member is obsolete. Please use instead.

  waitpid() returns the pid of the child. On error, -1 is returned and .GetLastWin32Error is set.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` a a a waitpid() will force a parent process to wait for a child process to stop or terminate. a

  This member is obsolete. Please use instead.

  waitpid() returns the pid of the child. On error, -1 is returned and .GetLastWin32Error is set. 'status' is an output parameter containing the exit code of the child process in question.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a WIFEXITSTATUS is a method that take an argument status, of type int, as returned by waitpid(). a

  This member is obsolete. Please use instead.

  Returns true (1) if process exited normally.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a WIFEXITED is a method that take an argument status, of type int, as returned by waitpid(). a

  This member is obsolete. Please use instead.

  Result is true (1) if the process has exited.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a WIFSIGNALED is a method that take an argument status, of type int, as returned by waitpid(). a

  This member is obsolete. Please use instead.

  WIFSIGNALED evaluates to true (1) when the process was terminated with a signal.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a WIFSTOPPED is a method that take an argument status, of type int, as returned by waitpid(). a

  This member is obsolete. Please use instead.

  WIFSTOPPED evaluates to true (1) when the process for which the wait() call was made is stopped, or to false (0) otherwise.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IntPtr `` `` `` a a a write writes up to 'count' bytes to the file referenced by the file descriptor 'fileDescriptor' from the buffer starting at 'buf'. a

  This member is obsolete. Please use instead.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a WSTOPSIG is a method that take an argument status, of type int, as returned by waitpid(). a

  This member is obsolete. Please use instead.

  Returns the signal which caused the child to stop

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` a WTERMSIG is a method that take an argument status, of type int, as returned by waitpid(). a

  This member is obsolete. Please use instead.

  Returns the signal which caused the child to terminate.