dnonblock.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef foodaemonnonblockhfoo
  2. #define foodaemonnonblockhfoo
  3. /***
  4. This file is part of libdaemon.
  5. Copyright 2003-2008 Lennart Poettering
  6. libdaemon is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU Lesser General Public License as
  8. published by the Free Software Foundation, either version 2.1 of the
  9. License, or (at your option) any later version.
  10. libdaemon is distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with libdaemon. If not, see
  16. <http://www.gnu.org/licenses/>.
  17. ***/
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /** \file
  22. *
  23. * Contains a single function used to change a file descriptor to
  24. * non-blocking mode using fcntl().
  25. */
  26. /** Change the passed file descriptor to non-blocking or blocking
  27. * mode, depending on b.
  28. * @param fd The file descriptor to manipulation
  29. * @param b TRUE if non-blocking mode should be enabled, FALSE if it
  30. * should be disabled
  31. * @return Zero on success, nonzero on failure.
  32. */
  33. int daemon_nonblock(int fd, int b);
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif