• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/56

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

56 Cards in this Set

  • Front
  • Back
00045 #define O_RDONLY 1
00046 #define O_WRONLY 2
00047 #define O_RDWR 3
00048 #define O_CREAT 4
00049 #define O_TRUNC 8
00050 #define O_APPEND 16

(((what head are these defined in?)))
unistd.h (standard symbolic constants and types)
00052 #define STDIN_FILENO 0
00053 #define STDOUT_FILENO 1
00054 #define STDERR_FILENO 2

(((what head are these defined in?)))
unistd.h (standard symbolic constants and types)
/* Values for the WHENCE argument to lseek. */
#ifndef _STDIO_H // <stdio.h> has the same definitions. */
# define SEEK_SET 0 // Seek from beginning of file.
# define SEEK_CUR 1 // Seek from current position.
# define SEEK_END 2 // Seek from end of file.
#endif

(((what head are these defined in?)))
unistd.h (standard symbolic constants and types)
(((dup,dup2)))

/* Duplicate FD, returning a new file descriptor on the same file. */
extern int dup (int __fd) __THROW __wur;

/* Duplicate FD to FD2, closing FD2 and making it open on the same file. */
extern int dup2 (int __fd, int __fd2) __THROW;
unistd.h (standard symbolic constants and types)
(((chdir)))

/* Change the process's working directory to PATH. */
extern int chdir (__const char *__path) __THROW __nonnull ((1)) __wur;
unistd.h (standard symbolic constants and types)
(((chown)))

/* Change the owner and group of FILE. */
extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
__THROW __nonnull ((1)) __wur;
unistd.h (standard symbolic constants and types)
((( pause )))

/* Suspend the process until a signal arrives.
This always returns -1 and sets `errno' to EINTR.

This function is a cancellation point and therefore not marked with
__THROW. */
extern int pause (void);
unistd.h (standard symbolic constants and types)
((( sleep )))

/* Make the process sleep for SECONDS seconds, or until a signal arrives
and is not ignored. The function returns the number of seconds less
than SECONDS which it actually slept (thus zero if it slept the full time).
If a signal handler does a `longjmp' or modifies the handling of the
SIGALRM signal while inside `sleep' call, the handling of the SIGALRM
signal afterwards is undefined. There is no return value to indicate
error, but if `sleep' returns SECONDS, it probably didn't work.

This function is a cancellation point and therefore not marked with
__THROW. */
extern unsigned int sleep (unsigned int __seconds);
unistd.h (standard symbolic constants and types)
((( pipe )))

/* Create a one-way communication channel (pipe).
If successful, two file descriptors are stored in PIPEDES;
bytes written on PIPEDES[1] can be read from PIPEDES[0].
Returns 0 if successful, -1 if not. */
extern int pipe (int __pipedes[2]) __THROW __wur;
unistd.h (standard symbolic constants and types)
((( close )))

/* Close the file descriptor FD.

This function is a cancellation point and therefore not marked with
__THROW. */
extern int close (int __fd);
unistd.h (standard symbolic constants and types)
((( read )))

/* Read NBYTES into BUF from FD. Return the
number read, -1 for errors or 0 for EOF.

This function is a cancellation point and therefore not marked with
__THROW. */
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur;
unistd.h (standard symbolic constants and types)
((( write )))

/* Write N bytes of BUF to FD. Return the number written, or -1.

This function is a cancellation point and therefore not marked with
__THROW. */
extern ssize_t write (int __fd, __const void *__buf, size_t __n) __wur;
unistd.h (standard symbolic constants and types)
((( lseek )))

/* Move FD's file position to OFFSET bytes from the
beginning of the file (if WHENCE is SEEK_SET),
the current position (if WHENCE is SEEK_CUR),
or the end of the file (if WHENCE is SEEK_END).
Return the new file position. */
#ifndef __USE_FILE_OFFSET64
extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW;
#else
unistd.h (standard symbolic constants and types)
((( execl, and other exec variations )))

/* Execute PATH with all arguments after PATH until
a NULL pointer and environment from `environ'. */
extern int execl (__const char *__path, __const char *__arg, ...)
__THROW __nonnull ((1));


(((other exec variations are included here as well)))
unistd.h (standard symbolic constants and types)
((( getpid (and others related to getting/setting the ID of a process) )))

/* Get the process ID of the calling process. */
extern __pid_t getpid (void) __THROW;

(((as well as getppid to get the parent's id)))
unistd.h (standard symbolic constants and types)
((( fork )))

/* Clone the calling process, creating an exact copy.
Return -1 for errors, 0 to the new process,
and the process ID of the new process to the old process. */
extern __pid_t fork (void) __THROW;
unistd.h (standard symbolic constants and types)
((( link, linkat(link, but for FD), symlink, readlink... etc )))

/* Make a link to FROM named TO. */
extern int link (__const char *__from, __const char *__to)
__THROW __nonnull ((1, 2)) __wur;
unistd.h (standard symbolic constants and types)
((( sysconf ... know how to USE this )))

/* Get the value of the system variable NAME. */
extern long int sysconf (int __name) __THROW;
unistd.h (standard symbolic constants and types)
((( pathconf / fpathconf ... know how to USE pathconf )))

/* Get file-specific configuration information about PATH. */
extern long int pathconf (__const char *__path, int __name)
__THROW __nonnull ((1));

/* Get file-specific configuration about descriptor FD. */
extern long int fpathconf (int __fd, int __name) __THROW;
unistd.h (standard symbolic constants and types)
((( rmdir )))

/* Remove the directory PATH. */
extern int rmdir (__const char *__path) __THROW __nonnull ((1));
unistd.h (standard symbolic constants and types)
((( tcgetpgrp, tcsetpgrp - not sure how relevant these are)))

/* Return the foreground process group ID of FD. */
extern __pid_t tcgetpgrp (int __fd) __THROW;

/* Set the foreground process group ID of FD set PGRP_ID. */
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;

((( there are similar functions for host name and domain name )))
unistd.h (standard symbolic constants and types)
((( getlogin and related login functions )))

/* Return the login name of the user.

This function is a possible cancellation points and therefore not
marked with __THROW. */
extern char *getlogin (void);
#if defined __USE_REENTRANT || defined __USE_POSIX199506
/* Return at most NAME_LEN characters of the login name of the user in NAME.
If it cannot be determined or some other error occurred, return the error
code. Otherwise return 0.
unistd.h (standard symbolic constants and types)
((( get, end, and set user shell )))

/* Successive calls return the shells listed in `/etc/shells'. */
extern char *getusershell (void) __THROW;
extern void endusershell (void) __THROW; /* Discard cached info. */
extern void setusershell (void) __THROW; /* Rewind and re-read the file. */
unistd.h (standard symbolic constants and types)
((( sync )))

/* Make all changes done to all files actually appear on disk. */
extern void sync (void) __THROW;
unistd.h (standard symbolic constants and types)
((( fcntl )))

/* Do the file control operation described by CMD on FD.
The remaining arguments are interpreted depending on CMD.

This function is a cancellation point and therefore not marked with
__THROW. */
extern int fcntl (int __fd, int __cmd, ...);
fcntl.h (file control options)
((( open )))

/* Open FILE and return a new file descriptor for it, or -1 on error.
OFLAG determines the type of access used. If O_CREAT is on OFLAG,
the third argument is taken as a `mode_t', the mode of the created file.

This function is a cancellation point and therefore not marked with
__THROW. */
#ifndef __USE_FILE_OFFSET64
extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
fcntl.h (file control options)
((( creat )))

/* Create and open FILE, with mode MODE. This takes an `int' MODE
argument because that is what `mode_t' will be widened to.

This function is a cancellation point and therefore not marked with
__THROW. */
#ifndef __USE_FILE_OFFSET64
extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1));
fcntl.h (file control options)
((( openat )))

#ifdef __USE_ATFILE
/* Similar to `open' but a relative path name is interpreted relative to
the directory for which FD is a descriptor.

NOTE: some other `openat' implementation support additional functionality
through this interface, especially using the O_XATTR flag. This is not
yet supported here.

This function is a cancellation point and therefore not marked with
__THROW. */
# ifndef __USE_FILE_OFFSET64
extern int openat (int __fd, __const char *__file, int __oflag, ...)
__nonnull ((2));
fcntl.h (file control options)
((( posix_fallocate )))

/* Reserve storage for the data of the file associated with FD.

This function is a possible cancellation points and therefore not
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
fcntl.h (file control options)
anything that ends with _MAX or _MIN will probably be in...
(because that's all it is, besides page size, file size(bits), and the recommend file transfer buffer alignment)
limits.h (implementation-defined constants, defines min/maxes)
((( fstat )))

The fstat() function obtains information about an open file associated with the file descriptor fildes, and writes it to the area pointed to by buf.

int fstat(int fildes, struct stat *buf);
sys/stat.h - data returned by the stat() function (Use of the macros is recommended for determining the type of a file.)
((( lstat )))

The lstat() function has the same effect as stat(), except when path refers to a symbolic link. In that case lstat() returns information about the link, while stat() returns information about the file the link references.

int lstat(const char *path, struct stat *buf);
sys/stat.h - data returned by the stat() function (Use of the macros is recommended for determining the type of a file.)
((( stat )))

The stat() function obtains information about the named file and writes it to the area pointed to by the buf argument. The path argument points to a pathname naming a file. Read, write or execute permission of the named file is not required, but all directories listed in the pathname leading to the file must be searchable. An implementation that provides additional or alternate file access control mechanisms may, under implementation-dependent conditions, cause stat() to fail. In particular, the system may deny the existence of the file specified by path.

int stat(const char *path, struct stat *buf);
sys/stat.h - data returned by the stat() function (Use of the macros is recommended for determining the type of a file.)
dev_t st_dev ID of device containing file
ino_t st_ino file serial number
mode_t st_mode mode of file (see below)
nlink_t st_nlink number of links to the file
uid_t st_uid user ID of file
gid_t st_gid group ID of file
dev_t st_rdev device ID (if file is character or block special)
off_t st_size file size in bytes (if file is a regular file)
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
time_t st_atime time of last access
time_t st_mtime time of last data modification
time_t st_ctime time of last status change

blksize_t st_blksize a filesystem-specific preferred I/O block size for this object. In some filesystem types, this may vary from file to file.

blkcnt_t st_blocks number of blocks allocated for this object
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
File type:

S_IFMT
type of file

S_IFBLK
block special

S_IFCHR
character special

S_IFIFO
FIFO special

S_IFREG
regular

S_IFDIR
directory

S_IFLNK
symbolic link
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
File mode bits:

S_IRWXU (or O, G at the end for other/group)
read, write, execute/search by owner

S_IRUSR (or GRP, OTH at the end for other/group)
read permission, owner

S_IWUSR (or GRP, OTH at the end for other/group)
write permission, owner

S_IXUSR (or GRP, OTH at the end for other/group)
execute/search permission, owner

S_ISUID
set-user-ID on execution

S_ISGID
set-group-ID on execution

S_ISVTX
on directories, restricted deletion flag
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
The following macros will test whether a file is of the specified type. The value m supplied to the macros is the value of st_mode from a stat structure. The macro evaluates to a non-zero value if the test is true, 0 if the test is false.

S_ISBLK(m)
Test for a block special file.
S_ISCHR(m)
Test for a character special file.
S_ISDIR(m)
Test for a directory.
S_ISFIFO(m)
Test for a pipe or FIFO special file.
S_ISREG(m)
Test for a regular file.
S_ISLNK(m)
Test for a symbolic link.
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
The implementation may implement message queues, semaphores, or shared memory objects as distinct file types. The following macros test whether a file is of the specified type. The value of the buf argument supplied to the macros is a pointer to a stat structure. The macro evaluates to a non-zero value if the specified object is implemented as a distinct file type and the specified file type is contained in the stat structure referenced by buf. Otherwise, the macro evaluates to zero.

S_TYPEISMQ(buf)
Test for a message queue
S_TYPEISSEM(buf)
Test for a semaphore
S_TYPEISSHM(buf)
Test for a shared memory object
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
int chmod(const char *, mode_t);

The chmod() function changes S_ISUID, S_ISGID, S_ISVTX and the file permission bits of the file named by the pathname pointed to by the path argument to the corresponding bits in the mode argument. The effective user ID of the process must match the owner of the file or the process must have appropriate privileges in order to do this.
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
int fchmod(int, mode_t);

The fchmod() function has the same effect as chmod() except that the file whose permissions are to be changed is specified by the file descriptor fildes.
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
int mkdir(const char *, mode_t);

The mkdir() function creates a new directory with name path. The file permission bits of the new directory are initialised from mode. These file permission bits of the mode argument are modified by the process' file creation mask.
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
int mkfifo(const char *, mode_t);

The mkfifo() function creates a new FIFO special file named by the pathname pointed to by path. The file permission bits of the new FIFO are initialised from mode. The file permission bits of the mode argument are modified by the process' file creation mask.
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
int mknod(const char *, mode_t, dev_t);

The mknod() function creates a new file named by the pathname to which the argument path points.
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
mode_t umask(mode_t);

The umask() function sets the process' file mode creation mask to cmask and returns the previous value of the mask. Only the file permission bits of cmask (see <sys/stat.h>) are used; the meaning of the other bits is implementation-dependent.

The process' file mode creation mask is used during open(), creat(), mkdir() and mkfifo() to turn off permission bits in the mode argument supplied. Bit positions that are set in cmask are cleared in the mode of the created file.
sys/stat.h - data returned by the stat() function (returns file attributes about an inode)
some macro names, defined as *POSITIVE* integral constant expressions:

BUFSIZ
Size of <stdio.h> buffers.
FILENAME_MAX
Maximum size in bytes of the longest filename string that the implementation guarantees can be opened.
FOPEN_MAX
Number of streams which the implementation guarantees can be open simultaneously. The value will be at least eight.
_IOFBF
Input/output fully buffered.
_IOLBF
Input/output line buffered.
_IONBF
Input/output unbuffered.
stdio.h - standard buffered input/output
some macro names, defined as *POSITIVE* integral constant expressions:

L_ctermid
Maximum size of character array to hold ctermid() output.
L_cuserid
Maximum size of character array to hold cuserid() output. (LEGACY)
L_tmpnam
Maximum size of character array to hold tmpnam() output.
SEEK_CUR
Seek relative to current position.
SEEK_END
Seek relative to end-of-file.
SEEK_SET
Seek relative to start-of-file.
TMP_MAX
Minimum number of unique filenames generated by tmpnam(). Maximum number of times an application can call tmpnam() reliably. The value of TMP_MAX will be at least 10,000.
stdio.h - standard buffered input/output
some macro names, defined as *NEGATIVE* integral constant expressions:

EOF
End-of-file return value.
The following macro name is defined as a null pointer constant:

NULL
Null pointer.
The following macro name is defined as a string constant:

P_tmpdir
default directory prefix for tempnam().
The following macro names are defined as expressions of type pointer to FILE:

stderr
Standard error output stream.
stdin
Standard input stream.
stdout
Standard output stream.
stdio.h - standard buffered input/output
The following data types are defined through typedef:

FILE
A structure containing information about a file.

fpos_t
Type containing all information needed to specify uniquely every position within a file.

va_list
As described in <stdarg.h>.

size_t
As described in <stddef.h>.
stdio.h - standard buffered input/output
((( grouped and undefined to save time, since there are a lot here, heh. There are probably a lot that can be ignored. Opengroup.org has good definitions of all, if interested )))

void clearerr(FILE *);
char *ctermid(char *);
char *cuserid(char *);(LEGACY)
int fclose(FILE *);
FILE *fdopen(int, const char *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE *, fpos_t *);
char *fgets(char *, int, FILE *);
int fileno(FILE *);
stdio.h - standard buffered input/output
((( grouped and undefined to save time, since there are a lot here, heh. There are probably a lot that can be ignored. Opengroup.org has good definitions of all, if interested )))

void flockfile(FILE *);
FILE *fopen(const char *, const char *);
int fprintf(FILE *, const char *, ...);
int fputc(int, FILE *);
int fputs(const char *, FILE *);
size_t fread(void *, size_t, size_t, FILE *);
FILE *freopen(const char *, const char *, FILE *);
int fscanf(FILE *, const char *, ...);
int fseek(FILE *, long int, int);
int fseeko(FILE *, off_t, int);
int fsetpos(FILE *, const fpos_t *);
long int ftell(FILE *);
off_t ftello(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
stdio.h - standard buffered input/output
((( grouped and undefined to save time, since there are a lot here, heh. There are probably a lot that can be ignored. Opengroup.org has good definitions of all, if interested )))

size_t fwrite(const void *, size_t, size_t, FILE *);
int getc(FILE *);
int getchar(void);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int getopt(int, char * const[], const char); (LEGACY)
char *gets(char *);
int getw(FILE *);
int pclose(FILE *);
void perror(const char *);
FILE *popen(const char *, const char *);
int printf(const char *, ...);
int putc(int, FILE *);
int putchar(int);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
int puts(const char *);
int putw(int, FILE *);
stdio.h - standard buffered input/output
((( grouped and undefined to save time, since there are a lot here, heh. There are probably a lot that can be ignored. Opengroup.org has good definitions of all, if interested )))


int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *);
int scanf(const char *, ...);
void setbuf(FILE *, char *);
int setvbuf(FILE *, char *, int, size_t);
int snprintf(char *, size_t, const char *, ...);
int sprintf(char *, const char *, ...);
int sscanf(const char *, const char *, int ...);
char *tempnam(const char *, const char *);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE *, const char *, va_list);
int vprintf(const char *, va_list);
int vsnprintf(char *, size_t, const char *, va_list);
int vsprintf(char *, const char *, va_list);
stdio.h - standard buffered input/output
The following external variables are defined:

extern char *optarg; )
extern int opterr; )
extern int optind; ) (LEGACY)
extern int optopt; )
stdio.h - standard buffered input/output
a definition for struct passwd, which shall include at least the following members:

char *pw_name User's login name.
uid_t pw_uid Numerical user ID.
gid_t pw_gid Numerical group ID.
char *pw_dir Initial working directory.
char *pw_shell Program to use as shell.

The gid_t and uid_t types shall be defined as described in <sys/types.h>.
pwd.h - password structure
The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

struct passwd *getpwnam(const char *);
struct passwd *getpwuid(uid_t);
[TSF]

int getpwnam_r(const char *, struct passwd *, char *,
size_t, struct passwd **);

int getpwuid_r(uid_t, struct passwd *, char *,
size_t, struct passwd **);
[XSI]

void endpwent(void);

struct passwd *getpwent(void);

void setpwent(void);
pwd.h - password structure