1 /*
2  * David Leonard <d@openbsd.org>, 1999. Public Domain.
3  *
4  * $OpenBSD: uthread_fchflags.c,v 1.1 1999/01/08 05:42:18 d Exp $
5  */
6 
7 #include <sys/stat.h>
8 #include <unistd.h>
9 #ifdef _THREAD_SAFE
10 #include <pthread.h>
11 #include "pthread_private.h"
12 
13 int
fchflags(int fd,unsigned int flags)14 fchflags(int fd, unsigned int flags)
15 {
16 	int             ret;
17 
18 	if ((ret = _FD_LOCK(fd, FD_WRITE, NULL)) == 0) {
19 		ret = _thread_sys_fchflags(fd, flags);
20 		_FD_UNLOCK(fd, FD_WRITE);
21 	}
22 	return (ret);
23 }
24 #endif
25