FreeBSD/lib/libthr/thread/thr_syscalls.c
/*
 * Cancellation behavior:
 *   If the thread is canceled, file is not opened.
 */
Cancellation behavior:
If the thread is canceled, file is not opened.
Cancellation behavior : If the thread is canceled file is not opened .
static int
__thr_openat(int fd, const char *path, int flags, ...)
{
	struct pthread *curthread;
	int mode, ret;
	va_list	ap;
	if ((flags & O_CREAT) != 0) {
		va_start(ap, flags);
		mode = va_arg(ap, int);
		va_end(ap);
	} else {
		mode = 0;
	}
	curthread = _get_curthread();
	_thr_cancel_enter(curthread);
	ret = __sys_openat(fd, path, flags, mode);
	_thr_cancel_leave(curthread, ret == -1);
	return (ret);
}
static int __thr_openat ( int fd , const char * path , int flags , ... ) { struct pthread * curthread ; int mode , ret ; va_list ap ; if ( ( flags & O_CREAT ) != 0 ) { va_start ( ap , flags ) ; mode = va_arg ( ap , int ) ; va_end ( ap ) ; } else { mode = 0 ; } curthread = _get_curthread ( ) ; _thr_cancel_enter ( curthread ) ; ret = __sys_openat ( fd , path , flags , mode ) ; _thr_cancel_leave ( curthread , ret == -1 ) ; return ( ret ) ; }
Cancellation behavior:
   If the thread is canceled, file is not opened.
Cancellation behavior : If the thread is canceled file is not opened .
/* Check if the file is being created: */ /* Get the creation mode: */