]> git.ozlabs.org Git - ccan/blob - ccan/noerr/noerr.h
559ba6132840543f4d9a2e4fa1dcb07cb9cdf6fb
[ccan] / ccan / noerr / noerr.h
1 #ifndef NOERR_H
2 #define NOERR_H
3
4 /**
5  * close_noerr - close without stomping errno.
6  * @fd: the file descriptor to close.
7  *
8  * errno is saved and restored across the call to close: if an error occurs,
9  * the resulting (non-zero) errno is returned.
10  */
11 int close_noerr(int fd);
12
13 /**
14  * unlink_noerr - unlink a file without stomping errno.
15  * @pathname: the path to unlink.
16  *
17  * errno is saved and restored across the call to unlink: if an error occurs,
18  * the resulting (non-zero) errno is returned.
19  */
20 int unlink_noerr(const char *pathname);
21
22 #endif /* NOERR_H */