File: unix.h

package info (click to toggle)
scheme48 1.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 14,980 kB
  • ctags: 14,127
  • sloc: lisp: 76,272; ansic: 71,514; sh: 3,026; makefile: 637
file content (36 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

/*
 * Macros for retrying interrupted system calls.  RETURN_NULL 
 */

#define RETRY_NULL(STATUS, CALL)				\
do {								\
  STATUS = (CALL);						\
} while ((STATUS == NULL) && (errno == EINTR))

#define RETRY_NEG(STATUS, CALL)					\
do {								\
  STATUS = (CALL);						\
} while ((STATUS < 0) && (errno == EINTR))

#define RETRY_OR_RAISE_NULL(STATUS, CALL)			\
do {								\
  while (1) {							\
    STATUS = (CALL);						\
    if (STATUS != NULL)						\
      break;							\
    else if (errno != EINTR)					\
      s48_raise_os_error(errno); }				\
 } while (0)

#define RETRY_OR_RAISE_NEG(STATUS, CALL)			\
do {								\
  while (1) {							\
    STATUS = (CALL);						\
    if (STATUS >= 0)						\
      break;							\
    else if (errno != EINTR)					\
      s48_raise_os_error(errno); }				\
 } while (0)