Skip to content

Instantly share code, notes, and snippets.

struct tms {
clock_t tms_utime; /* user CPU time */
clock_t tms_stime; /* system CPU time */
clock_t tms_cutime; /* user CPU time, terminated children */
clock_t tms_cstime; /* system CPU time, terminated children */
};
#include <sys/resource.h>
int setpriority(int which, id_t who, int value);
/* Returns: 0 if OK, −1 on error */
#include <sys/resource.h>
int getpriority(int which, id_t who);
/* Returns: nice value between −NZERO and NZERO−1 if OK, −1 on error */
#include <unistd.h>
int nice(int incr);
/* Returns: new nice value − NZERO if OK, −1 on error */
#include <unistd.h>
char *getlogin(void);
/* Returns: pointer to string giving login name if OK, NULL on error */
typedef u_short comp_t; /* 3-bit base 8 exponent; 13-bit fraction */
struct acct
{
char ac_flag; /* flag (see Figure 8.26) */
char ac_stat; /* termination status (signal & core flag only) */
/* (Solaris only) */
uid_t ac_uid; /* real user ID */
gid_t ac_gid; /* real group ID */
dev_t ac_tty; /* controlling terminal */
#include <stdlib.h>
int system(const char *cmdstring);
#include <unistd.h>
int seteuid(uid_t uid);
int setegid(gid_t gid);
/* Both return: 0 if OK, −1 on error */
#include <unistd.h>
int setreuid(uid_t ruid, uid_t euid);
int setregid(gid_t rgid, gid_t egid);
/* Both return: 0 if OK, −1 on error */
#include <unistd.h>
int setuid(uid_t uid);
int setgid(gid_t gid);
/* Both return: 0 if OK, −1 on error */