Advanced Programming in the UNIX® Environment

(lily) #1
ptg10805159

Appendix A Function Prototypes 849


unsigned
int CMSG_LEN(unsigned intnbytes);
<sys/socket.h> p. 645
Returns: size to allocate for data objectnbyteslarge

struct
cmsghdr *CMSG_NXTHDR(struct msghdr *mp,struct cmsghdr *cp);
<sys/socket.h> p. 645
Returns: pointer to nextcmsghdrstructureassociated with
themsghdrstructuregiven the currentcmsghdr
structure, orNULLif we’re at the last one

int connect(intsockfd,const struct sockaddr *addr,
socklen_tlen);
<sys/socket.h> p. 605
Returns: 0 if OK,−1 on error

int creat(const char *path,mode_tmode);
<fcntl.h> p. 66
mode:S_IS[UG]ID, S_ISVTX,
S_I[RWX](USR|GRP|OTH)
Returns: file descriptor opened for write-only if OK,
−1 on error

char *ctermid(char *ptr);
<stdio.h> p. 694
Returns: pointer to name of controlling terminal on success,
pointer to empty string on error

int dprintf(intfd,const char *restrictformat,...);
<stdio.h> p. 159
Returns: number of characters output if OK, negative value
if output error

int dup(intfd);
<unistd.h> p. 79
Returns: new file descriptor if OK,−1 on error

int dup2(intfd,intfd2);
<unistd.h> p. 79
Returns: new file descriptor if OK,−1 on error

void endgrent(void);
<grp.h> p. 183

void endhostent(void);
<netdb.h> p. 597
Free download pdf