
148
"C" Programming Guide For Optimus S/R
See Also
accept, getpeername, getsockname, listen, select, socket
fcntlsocket
Purpose
To provide file control over descriptors.
Syntax
int fcntlsocket (int fildes, int cmd, int arg);
Example
(?)
Description
The routine provides for control over descriptors.
The argument
fildes
is a descriptor to be operated on by cmd as described
below.
cmd
O_NDELAY
non-blocking (?)
FNDELAY O_NDELAY synonym (?)
F_GETFL
Get descriptor status flags (arg is ignored).
F_SETFL
Set descriptor status flags to arg.
Depending on the value of cmd, it can take an additional third argument
arg
.
Return
If successful, it returns a non-negative value depending on
cmd
.
Otherwise, it returns -1.
The global variable
errno
is set to indicate the error condition encountered.
See Also
gethostbyname
Purpose
To get network host entry.
Syntax
struct hostent *gethostbname (const char *hnp);
hnp
Pointer to a buffer containing a null-terminated host name
Example
SOCKET s;
struct sockaddr_in name;
struct hostent *phostent;
s = socket (PF_INET, SOCK_STREAM, TCP);
if (s < 0) {
printf ("SOCKET allocation failed");
.......................
}
memset (&name, 0, sizeof (name));
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...