more cancellation points: tcdrain, clock_nanosleep

This commit is contained in:
Rich Felker 2011-03-10 11:06:50 -05:00
parent c8c4ef7d44
commit 11dbbe9fba
2 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,12 @@
#include <termios.h> #include <termios.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "libc.h"
int tcdrain(int fd) int tcdrain(int fd)
{ {
return ioctl(fd, TCSBRK, 1); int ret;
CANCELPT_BEGIN;
ret = ioctl(fd, TCSBRK, 1);
CANCELPT_END;
return ret;
} }

View File

@ -1,8 +1,13 @@
#define SYSCALL_RETURN_ERRNO #define SYSCALL_RETURN_ERRNO
#include <time.h> #include <time.h>
#include "syscall.h" #include "syscall.h"
#include "libc.h"
int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem) int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem)
{ {
return syscall4(__NR_clock_nanosleep, clk, flags, (long)req, (long)rem); int ret;
CANCELPT_BEGIN;
ret = syscall4(__NR_clock_nanosleep, clk, flags, (long)req, (long)rem);
CANCELPT_END;
return ret;
} }