freebsd-dev/lib/libc_r/uthread/uthread_fchflags.c
Alfred Perlstein 7285bccf1a add pthread_cancel, obtained from OpenBSD.
eischen (Daniel Eischen) added wrappers to protect against cancled
threads orphaning internal resources.

the cancelability code is still a bit fuzzy but works for test
programs of my own, OpenBSD's and some examples from ORA's books.

add readdir_r to both libc and libc_r

add some 'const' attributes to function parameters

Reviewed by: eischen, jasone
1999-11-28 05:38:13 +00:00

26 lines
464 B
C

/*
* David Leonard <d@openbsd.org>, 1999. Public Domain.
*
* $OpenBSD: uthread_fchflags.c,v 1.1 1999/01/08 05:42:18 d Exp $
* $FreeBSD$
*/
#include <sys/stat.h>
#include <unistd.h>
#ifdef _THREAD_SAFE
#include <pthread.h>
#include "pthread_private.h"
int
fchflags(int fd, u_long flags)
{
int ret;
if ((ret = _FD_LOCK(fd, FD_WRITE, NULL)) == 0) {
ret = _thread_sys_fchflags(fd, flags);
_FD_UNLOCK(fd, FD_WRITE);
}
return (ret);
}
#endif