Class Posix
Provides support for calling standard POSIX functions.
The method names are deliberately using "POSIX-style", i.e. short, C-oriented names for methods like getuid
,
getpid
and so forth. This is to make it simple for people with experience from POSIX-based systems to find the
method they are looking for.
This class only contains POSIX-specific functions, i.e. functions available on POSIX-compliant systems like BSD, GNU/Linux and macOS, but not available on Windows. For C functions available on all supported platforms, see the list below.
Code which uses this class will only run on POSIX-compliant systems. If an attempt to use these methods is made on Windows, a compile-time error is emitted.
List of methods defined in POSIX but available elsewhere:
Inheritance
Namespace: Perlang.Stdlib
Assembly: Perlang.Stdlib.dll
Syntax
public static class Posix : object
Remarks
The XML method descriptions are based on man
pages in the NetBSD source code.
The full license of these man pages can be found at https://gitlab.perlang.org/perlang/perlang/-/blob/master/NOTICE.md
There might be subtle differences between systems on some of these functions. For information on how these work
on e.g. GNU/Linux, use a command like man 2 getgid
(replace getgid
with the name of the function you are
interested in). You can also consult the Linux man pages project:
https://man7.org/linux/man-pages/dir_all_alphabetic.html/.
Methods
| Improve this Doc View Sourcegetegid()
The `getgid()` function returns the real group ID of the calling process, getegid() returns the effective group ID of the calling process.
The real group ID is specified at login time.
The real group ID is the group of the user who invoked the program. As the effective group ID gives the
process additional permissions during the execution of set-group-ID
mode processes, getgid() is used to determine the real-group-id of the calling process.
getgid() and getegid() conform to ISO/IEC 9945-1:1990
(POSIX.1
).
Declaration
public static int getegid()
Returns
Type | Description |
---|---|
System.Int32 | The effective group ID of the calling process. |
See Also
| Improve this Doc View Sourcegeteuid()
The getuid() function returns the real user ID of the calling process. The geteuid() function returns the effective user ID of the calling process.
The real user ID is that of the user who has invoked the program. As the effective user ID gives the
process additional permissions during execution of set-user-ID
mode processes, getuid() is used to determine the real-user-id of the calling process.
The geteuid() and getuid() functions conform to ISO/IEC
9945-1:1990 (POSIX.1
).
Declaration
public static int geteuid()
Returns
Type | Description |
---|---|
System.Int32 | The effective user ID of the calling process. |
See Also
| Improve this Doc View Sourcegetgid()
The `getgid()` function returns the real group ID of the calling process, getegid() returns the effective group ID of the calling process.
The real group ID is specified at login time.
The real group ID is the group of the user who invoked the program. As the effective group ID gives the
process additional permissions during the execution of set-group-ID
mode processes, getgid() is used to determine the real-group-id of the calling process.
getgid() and getegid() conform to ISO/IEC 9945-1:1990
(POSIX.1
).
Declaration
public static int getgid()
Returns
Type | Description |
---|---|
System.Int32 | The real group ID of the calling process. |
getppid()
Returns the process ID of the parent of the calling process.
getppid() conform to ISO/IEC 9945-1:1990 (POSIX.1
).
Declaration
public static int getppid()
Returns
Type | Description |
---|---|
System.Int32 | The parent process ID. |
See Also
| Improve this Doc View Sourcegetuid()
The getuid() function returns the real user ID of the calling process. The geteuid() function returns the effective user ID of the calling process.
The real user ID is that of the user who has invoked the program. As the effective user ID gives the
process additional permissions during execution of set-user-ID
mode processes, getuid() is used to determine the real-user-id of the calling process.
The geteuid() and getuid() functions conform to ISO/IEC
9945-1:1990 (POSIX.1
).
Declaration
public static int getuid()
Returns
Type | Description |
---|---|
System.Int32 | The real user ID of the calling process. |