noerr.h 567 B

12345678910111213141516171819202122
  1. #ifndef NOERR_H
  2. #define NOERR_H
  3. /**
  4. * close_noerr - close without stomping errno.
  5. * @fd: the file descriptor to close.
  6. *
  7. * errno is saved and restored across the call to close: if an error occurs,
  8. * the resulting (non-zero) errno is returned.
  9. */
  10. int close_noerr(int fd);
  11. /**
  12. * unlink_noerr - unlink a file without stomping errno.
  13. * @pathname: the path to unlink.
  14. *
  15. * errno is saved and restored across the call to unlink: if an error occurs,
  16. * the resulting (non-zero) errno is returned.
  17. */
  18. int unlink_noerr(const char *pathname);
  19. #endif /* NOERR_H */