xref: /haiku/src/system/libroot/posix/unistd/close.c (revision 5af32e752606778be5dd7379f319fe43cb3f6b8c)
1 /*
2 ** Copyright 2001, Manuel J. Petit. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 
6 
7 #include <unistd.h>
8 #include <syscalls.h>
9 #include <errno.h>
10 
11 
12 int
13 close(int fd)
14 {
15 	int retval = _kern_close(fd);
16 	if (retval < 0) {
17 		errno = retval;
18 		retval = -1;
19 	}
20 
21 	return retval;
22 }
23