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));
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...