ptg10805159Appendix A Function Prototypes 849
unsigned
int CMSG_LEN(unsigned intnbytes);
<sys/socket.h> p. 645
Returns: size to allocate for data objectnbyteslargestruct
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 oneint connect(intsockfd,const struct sockaddr *addr,
socklen_tlen);
<sys/socket.h> p. 605
Returns: 0 if OK,−1 on errorint 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 errorchar *ctermid(char *ptr);
<stdio.h> p. 694
Returns: pointer to name of controlling terminal on success,
pointer to empty string on errorint dprintf(intfd,const char *restrictformat,...);
<stdio.h> p. 159
Returns: number of characters output if OK, negative value
if output errorint dup(intfd);
<unistd.h> p. 79
Returns: new file descriptor if OK,−1 on errorint dup2(intfd,intfd2);
<unistd.h> p. 79
Returns: new file descriptor if OK,−1 on errorvoid endgrent(void);
<grp.h> p. 183void endhostent(void);
<netdb.h> p. 597