nn::socket::Fcntl Function

Syntax

s32 Fcntl(
     s32 s,
     s32 cmd,
     s32 val
);

Arguments

Name Description
in s Specifies the socket descriptor. Specify a socket descriptor created using the Socket or Accept function.
in cmd Specifies what to do with the status flags.
F_GETFL: Read the status flags.
F_SETFL: Change the status flags.
in val Specifies additional arguments required for certain actions. If cmd is F_GETFL, there are no additional arguments required and this argument is ignored. If cmd is F_SETFL, this specifies the status flags to set. Specify 0 or a bitwise OR of the following values.
O_NONBLOCK: Sets the socket to non-blocking mode. If this flag is not specified, the socket will be in blocking mode. Note that a socket is set in blocking mode by default at time of creation.

Return Values



Value Description
0 Process was successful.
ENETRESET Socket library is not initialized.
ENETDOWN The network is not available.
EBADF Invalid socket descriptor.

Description

Sets or gets socket status flags.

See Also

Accept, Connect, Recv, Send

Revision History

2010/06/14
Initial version.

CONFIDENTIAL