CS241FA17-38-ExamDeclarations.pdf - An incomplete non-exhaustive list of useful library and system calls covered in CS241 For brevity const and restrict

CS241FA17-38-ExamDeclarations.pdf - An incomplete...

This preview shows page 1 - 2 out of 2 pages.

An incomplete, non-exhaustive list of useful library and system calls covered in CS241. For brevity, const and restrictkeywords not shown. In written answers you may safely shorten pthread calls and macros, provided it is unambiguous tothe grader. e.g. You may writep_m_t lock = P_M_Iinstead ofpthread_mutex_t lock = PTHREAD_MUTEX_INITALIZERvoid *memcpy(void *dest, void *src, size_t n)void *memset(void *b, int c, size_t len)char *strcpy(char *dest, char *src)char *strcat(char *dest,char*src)char *strncpy(char *dest,char*src, size_t n)char *strncat(char *dest,char*src, size_t n)int strcmp(char *s1, char *s2)int strncmp(char *s1, char *s2, size_t n)void *calloc(size_t nmemb, size_t size)void *malloc(size_t size)void free(void *ptr)void *realloc(void *ptr, size_t size)pid_t fork()char * getenv(char *name)int execve(char *path, char *argv[], char *envp[])int execl(char *path, char *arg0, ... ) /* arg0 will be process name. Last arg must be (char*)0 */pid_t getpid()pid_t getppid()int kill(pid_t pid, int sig) /* SIGINT, SIGKILL,SIGALRM ... */pid_t wait(int *stat_loc)pid_t waitpid(pid_t pid, int *stat_loc, int options) WIFEXITED ,WIFSIGNALED,WEXITSTATUS. options=WNOHANGWIFEXITED(status) returns True if the process terminated normally by a call to _exit(2) or exit(3).WIFSIGNALED(status) returns True if the process terminated due to receipt of a signal.WEXITSTATUS(status) If WIFEXITED(status) is true, evaluates to the low-order 8 bits of the process's exit value.
Background image
Image of page 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture