📄 other calls2.txt
字号:
sigset_t sgetmask(void);
sigset_t ssetmask(sigset_t mask);
PARAMETERS
mask: [in] the new signal mask.
DESCRIPTION
sgetmask retreives the signal mask of the current task and ssetmask sets it to mask. A
signal is blocked by setting the bit corresponding to the signal number in mask.
RETURN VALUE
Both calls return the signal mask at the time of the call (that means, in the case of
ssetmask before modifying it).
***************************************************************************************
sigsuspend
SYNOPSIS
sigsuspend(int restart, sigset_t old_mask, sigset_t set);
PARAMETERS
restart: [in] the sources take the address of this parameter to alter the stack frame...
old_mask: [in] this is not used in the kernel sources!!!
set: [in] the new signal mask.
DESCRIPTION
Atomically sets the signal mask to set and waits for a signal to occur.
RETURN VALUE
Always -1 and errno is set to EINTR.
***************************************************************************************
sigpending
SYNOPSIS
int sigpending(sigset_t *buf);
PARAMETERS
buf: [out] points to a buffer where to store the signal set.
DESCRIPTION
Retreives the set of pending signals.
RETURN VALUE
On success, returns zero. On error, returns -1 and errno is set to EFAULT.
***************************************************************************************
sigprocmask
SYNOPSIS
int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
PARAMETERS
how: [in] what to do whit the signal set.
set: [in] the signal set.
oset: [out] the previous signal mask.
DESCRIPTION
Modifies the signal mask. The parameter how can take one of the following values:
SIG_BLOCK
mask |= set. Adds new signals to the set of blocked signals.
SIG_UNBLOCK
mask &= ~set. Removes the signals from he set of blocked signals.
SIG_SETMASK
mask = set. set becomes the new signal mask.
RETURN VALUE
On success, returns zero. On error, returns -1 and sets errno to one of the following values
:
EINVAL: how has an invalid value.
EFAULT.
***************************************************************************************
sigreturn
SYNOPSIS
int sys_sigreturn(unsigned long __unused);
PARAMETERS
__unused: unused
DESCRIPTION
This syscall is not used in source code. This syscall is generated by the kernel (!) so that
it is call upon return from a signal handler.
RETURN VALUE
Very variable.
***************************************************************************************
stime
SYNOPSIS
int stime(time_t *t);
PARAMETERS
t: [in] the new time.
DESCRIPTION
Sets the time and date of the system. t is measured in seconds since 00:00:00 GMT January
1, 1970. The calling task must have superuser privileges for the call to succeed.
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to EPERM because the
calling task did not have superuser privileges.
***************************************************************************************
swapoff and swapon
SYNOPSIS
int swapon(const char *path);
int swapoff(const char *path);
PARAMETERS
path: [in] points to the path to add/remove.
DESCRIPTION
swapon adds the swap area specified by path to the swap pool. swapoff removes the swap area
specified by path from the swap pool. The calling task must have superuser privileges.
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to one of the
following:
EPERM: the calling task does not have superuser privileges.
EINVAL: path is not a block device nor a regular path.
ENOENT or ENOMEM.
***************************************************************************************
sysinfo
SYNOPSIS
int sysinfo(struct sysinfo *info);
PARAMETERS
info: [out] buffer where to store the info.
DESCRIPTION
Returns system information and statistics. (What a surprise!!!) The sysinfo structure has
the following layout:
struct sysinfo }
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
char _f[22]; /* Pads structure to 64 bytes */
};
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to EFAULT.
***************************************************************************************
time
SYNOPSIS
time_t time(time_t *t);
PARAMETERS
t: [out] where to store the time.
DESCRIPTION
Returns the time in seconds from 00:00:00 GMT January 1, 1970. If t is not NULL, the value
is also stored there.
RETURN VALUE
The time (see description).
***************************************************************************************
times
SYNOPSIS
clock_t times(struct tms *buf);
PARAMETERS
buf: [out] where to store the times.
DESCRIPTION
Retreives the current task times. The tms structure has the layout:
struct tms {
time_t tms_utime; /* user time */
time_t tms_stime; /* system time */
time_t tms_cutime; /* user time of children */
time_t tms_cstime; /* system time of children */
};
RETURN VALUE
The number of system ticks elapsed since the system has booted.
***************************************************************************************
uname
SYNOPSIS
int uname(struct utsname *buf);
PARAMETERS
buf: [out] where to store the information.
DESCRIPTION
Retreives some information on the system. The structure utsname has the following layout:
struct utsname {
char sysname[65];
char nodename[65];
char release[65];
char version[65];
char machine[65];
char domainname[65];
};
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to EFAULT.
***************************************************************************************
uselib
SYNOPSIS
int uselib(const char *library);
PARAMETERS
library: [in] points to the path of the shared library to load.
DESCRIPTION
Loads and map a shared library in the current task address space.
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to one of the
following values:
all the possible error values of open and mmap.
NOEXEC: the file does not have the necessary magic number or it is not executable.
***************************************************************************************
vhangup
SYNOPSIS
int vhangup(void);
DESCRIPTION
Simulates a hang up on the current terminal.
RETURN VALUE
On success zero is returned. On error -1 is returned and errno is set to EPERM: the calling
taks does not have superuser privileges.
***************************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -