sw_close is required by the internal management functions: remove socket
element when sw_close is called.
list_unlink_err:
return -1;
}
+
+/*
+ * Close file descriptor for socket FD.
+ * Returns 0 on success, -1 for errors.
+ */
+int sw_close (int __fd)
+{
+ struct sock_list *list;
+
+ /* Remove socket from socket management structure. */
+ list = list_unlink_socket(__fd);
+ if (list == NULL) {
+ errno = EBADF;
+ goto list_unlink_err;
+ }
+
+ /* Call classical interface of close(2). */
+ return close(__fd);
+
+list_unlink_err:
+ return -1;
+}
*/
extern int sw_shutdown (int __fd, int __how) __THROW;
+/*
+ * Close file descriptor for socket FD.
+ * Returns 0 on success, -1 for errors.
+ */
+extern int sw_close (int __fd);
+
#ifdef __cplusplus
}
#endif