Functions ¶ unix_accept (Function) unix_bind (Function) unix_close (Function) unix_connect (Function) unix_create (Function) unix_errno (Function) unix_listen (Function) unix_recv (Function) unix_send (Function) unix_unlink (Function)
unix_accept (FUN) ¶ FUNCTION unix_accept : INT accept a connection on a socket see manpage accept Returnvalue: On success, these system calls return a file descriptor for the accepted socket (a nonnegative integer). On error, -1 is returned, errno is set to indicate the error, and addrlen is left unchanged. no address can be obtained for unix domain socket (only file descr). InOut: Scope Name Type Return unix_accept INT Input sockfd INT
unix_bind (FUN) ¶ FUNCTION unix_bind : INT bind a pathname to a unix domain socket see manpage bind. The ownergroup of the created socketfile can be set to the default group codesysuser with USE_CODESYSGROUP. If placed in the default path /var/run/codesysextension/ this will have no effect, since the SIGD bit is set for this folder. The permissions of the created socketfile can be set to 600, 660, 666, depending on the used permission flag. Use only one of these: PERMISSION_OWNER will set the filepermission to 600. PERMISSION_OWNER_GROUP will set the filepermission to 660. PERMISSION_EVERYONE will set the filepermission to 666. No combination of the permission flags are possible, but it is possible to set one of the filepermissions and the ownergroup. Returnvalue: On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error. InOut: Scope Name Type Return unix_bind INT Input sockfd INT pathname STRING(108) mode BYTE
unix_close (FUN) ¶ FUNCTION unix_close : INT close a file descriptor see manpage close Returnvalue: returns zero on success. On error, -1 is returned, and errno is set to indicate the error. InOut: Scope Name Type Return unix_close INT Input sockfd INT
unix_connect (FUN) ¶ FUNCTION unix_connect : INT initiate a connection on a socket see manpage connect Returnvalue: If the connection or binding succeeds, zero is returned. On error, -1 is returned, and errno is set to indicate the error. InOut: Scope Name Type Return unix_connect INT Input sockfd INT pathname STRING(108)
unix_create (FUN) ¶ FUNCTION unix_create : INT create unix domain socket (nonblocking) (flag SOCK_NONBLOCK is set, protocol is 0) see manpage socket/unix domain socket Returnvalue: On success, a file descriptor for the new socket is returned. On error, -1 is returned, and errno is set to indicate the error. InOut: Scope Name Type Return unix_create INT Input socket_type INT
unix_errno (FUN) ¶ FUNCTION unix_errno : ERRNO get last errno read last stored errno InOut: Scope Name Type Return unix_errno ERRNO
unix_listen (FUN) ¶ FUNCTION unix_listen : INT listen for connections on a socket see manpage listen Returnvalue: On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error. InOut: Scope Name Type Return unix_listen INT Input sockfd INT backlog INT
unix_recv (FUN) ¶ FUNCTION unix_recv : INT receive a message from a unix domain socket see manpage recv Returnvalue: returns the number of bytes received, or -1 if an error occurred. In the event of an error, errno is set to indicate the error. Internally, this function calls recv(), which returns of type ssize_t. This might be different to the return value of the IEC function unix_recv, which is INT. Calling with length >= INT Max can lead to invalid return values of this function. InOut: Scope Name Type Return unix_recv INT Input sockfd INT buf POINTER TO BYTE len ULINT flags INT
unix_send (FUN) ¶ FUNCTION unix_send : INT send a message on a unix domain socket see manpage send Returnvalue: On success, this call returns the number of bytes sent. On error, -1 is returned, and errno is set to indicate the error. Internally, this function calls send() which returns of type ssize_t. This might be different to the return value of the IEC function unix_send, which is INT. Calling with length >= INT Max can lead to invalid return values of this function. InOut: Scope Name Type Return unix_send INT Input sockfd INT buf POINTER TO BYTE len ULINT flags INT