nn::socket::Fcntl Function

Syntax

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

Arguments

Name Description
in s Specifies a socket descriptor. Specifies 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.
EBADF The socket descriptor is invalid.
EINVAL Indicates an illegal call of one of the following. The control method specified by cmd is invalid.
ENETDOWN The network is not available.
ENETRESET Socket library is not initialized.
ENOMEM Cannot allocate the memory required for the process.

Description

Sets or gets socket status flags.

See Also

Accept
Connect
Recv
Send

Revision History

2010/06/14
Initial version.

CONFIDENTIAL