freebsd-nq/lib/libc_r/uthread/uthread_fchflags.c
Daniel Eischen 437df4859a To be consistent, use the __weak_reference macro from <sys/cdefs.h>
instead of #pragma weak to create weak definitions.

Suggested by:	bde
2001-04-10 04:19:21 +00:00

25 lines
471 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>
#include <pthread.h>
#include "pthread_private.h"
__weak_reference(_fchflags, fchflags);
int
_fchflags(int fd, u_long flags)
{
int ret;
if ((ret = _FD_LOCK(fd, FD_WRITE, NULL)) == 0) {
ret = __sys_fchflags(fd, flags);
_FD_UNLOCK(fd, FD_WRITE);
}
return (ret);
}