1/* 2 * David Leonard <d@openbsd.org>, 1999. Public Domain. 3 * 4 * $OpenBSD: uthread_msync.c,v 1.2 1999/06/09 07:16:17 d Exp $ 5 *
|
6 * $FreeBSD: head/lib/libkse/thread/thr_msync.c 53812 1999-11-28 05:38:13Z alfred $
|
6 * $FreeBSD: head/lib/libkse/thread/thr_msync.c 55838 2000-01-12 09:28:58Z jasone $ |
7 */ 8 9#include <sys/types.h> 10#include <sys/mman.h> 11#ifdef _THREAD_SAFE 12#include <pthread.h> 13#include "pthread_private.h" 14 15int
|
16msync(addr, len, flags)
|
16_libc_msync(addr, len, flags) |
17 void *addr; 18 size_t len; 19 int flags; 20{ 21 int ret; 22 23 /* 24 * XXX This is quite pointless unless we know how to get the 25 * file descriptor associated with the memory, and lock it for 26 * write. The only real use of this wrapper is to guarantee 27 * a cancellation point, as per the standard. sigh. 28 */ 29 30 /* This is a cancellation point: */ 31 _thread_enter_cancellation_point(); 32 33 ret = _thread_sys_msync(addr, len, flags); 34 35 /* No longer in a cancellation point: */ 36 _thread_leave_cancellation_point(); 37 38 return (ret); 39}
|
40 41__weak_reference(_libc_msync, msync); |
42#endif
|