The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

SPVM::Sys::User - User/Group System Calls

Description

The Sys::User class in SPVM has methods to call user/group system calls.

Usage

  use Sys::User;
  
  my $effective_user_id = Sys::User->geteuid;

Class Methods

getuid

static method getuid : int ();

Calls the getuid function and returns its return value.

Exceptions:

In Windows the following exception is thrown. getuid is not supported in this system(defined(_WIN32)).

geteuid

static method geteuid : int ();

Calls the geteuid function and returns its return value.

Exceptions:

In Windows the following exception is thrown. geteuid is not supported in this system(defined(_WIN32)).

getgid

static method getgid : int ();

Calls the getgid function and returns its return value.

Exceptions:

In Windows the following exception is thrown. getgid is not supported in this system(defined(_WIN32)).

getegid

static method getegid : int ();

Calls the getegid function and returns its return value.

Exceptions:

In Windows the following exception is thrown. getegid is not supported in this system(defined(_WIN32)).

setuid

static method setuid : int ($uid : int);

Calls the setuid function and returns its return value.

Exceptions:

If the setuid function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. setuid is not supported in this system(defined(_WIN32)).

seteuid

static method seteuid : int ($euid : int);

Calls the seteuid function and returns its return value.

Exceptions:

If the seteuid function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. seteuid is not supported in this system(defined(_WIN32)).

setgid

static method setgid : int ($gid : int);

Calls the setgid function and returns its return value.

Exceptions:

If the setgid function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. setgid is not supported in this system(defined(_WIN32)).

setegid

static method setegid : int ($egid : int);

Calls the setegid function and returns its return value.

Exceptions:

If the setegid function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. setegid is not supported in this system(defined(_WIN32)).

setpwent

static method setpwent : void ();

Calls the setpwent function and returns its return value.

Exceptions:

In Windows the following exception is thrown. setpwent is not supported in this system(defined(_WIN32)).

endpwent

static method endpwent : void ();

Calls the endpwent function and returns its return value.

Exceptions:

In Windows the following exception is thrown. endpwent is not supported in this system(defined(_WIN32)).

getpwent

static method getpwent : Sys::User::Passwd ();

Calls the getpwent function.

And if its return value is NULL, returns undef, otherwise creates a new Sys::User::Passwd object whose pointer is set to function's return value, and returns it.

Exceptions:

If the getpwent function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. getpwent is not supported in this system(defined(_WIN32)).

setgrent

static method setgrent : void ();

Calls the setgrent function.

Exceptions:

In Windows the following exception is thrown. setgrent is not supported in this system(defined(_WIN32)).

endgrent

static method endgrent : void ();

Calls the endgrent function.

Exceptions:

In Windows the following exception is thrown. endgrent is not supported in this system(defined(_WIN32)).

getgrent

static method getgrent : Sys::User::Group ();

Calls the getgrent function.

And if its return value is NULL, returns undef, otherwise creates a new Sys::User::Group object whose pointer is set to function's return value, and returns it.

Exceptions:

If the getgrent function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. getgrent is not supported in this system(defined(_WIN32)).

getgroups

static method getgroups : int ($size : int, $list : int[]);

Calls the getgroups function, and returns its return value.

Exceptions:

If the getgroups function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. getgroups is not supported in this system(defined(_WIN32)).

setgroups

static method setgroups : void ($groups : int[]);

Calls the setgroups function.

Exceptions:

If the setgroups function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. setgroups is not supported in this system(defined(_WIN32)).

getpwuid

static method getpwuid : Sys::User::Passwd ($id : int);

Calls the getpwuid function.

And if its return value is NULL, returns undef, otherwise creates a new Sys::User::Passwd object whose pointer is set to function's return value, and returns it.

Exceptions:

If the getpwuid function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. getpwuid is not supported in this system(defined(_WIN32)).

getpwnam

static method getpwnam : Sys::User::Passwd ($name : string);

Calls the getpwnam function.

And if its return value is NULL, returns undef, otherwise creates a new Sys::User::Passwd object whose pointer is set to function's return value, and returns it.

Exceptions:

If the getpwnam function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. getpwnam is not supported in this system(defined(_WIN32)).

getgrgid

static method getgrgid : Sys::User::Group ($id : int);

Calls the getgrgid function.

And if its return value is NULL, returns undef, otherwise creates a new Sys::User::Group object whose pointer is set to function's return value, and returns it.

Exceptions:

If the getgrgid function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. getgrgid is not supported in this system(defined(_WIN32)).

getgrnam

static method getgrnam : Sys::User::Group ($name : string);

Calls the getgrnam function.

And if its return value is NULL, returns undef, otherwise creates a new Sys::User::Group object whose pointer is set to function's return value, and returns it.

Exceptions:

If the getgrnam function failed, an exception is thrown with eval_error_id set to the basic type ID of the Error::System class.

In Windows the following exception is thrown. getgrnam is not supported in this system(defined(_WIN32)).

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License