FreeBSD misc: add a macro to turn on NETGRAPH option and return error when call sleep

This commit is contained in:
logwang 2017-10-27 18:08:44 +08:00
parent c36e692a8e
commit a416aa0841
3 changed files with 7 additions and 1 deletions

View File

@ -109,7 +109,9 @@ VPATH+= $S/crypto/rijndael
VPATH+= $S/crypto/sha2
VPATH+= $S/crypto/siphash
VPATH+= $S/net
ifdef FF_NETGRAPH
VPATH+= $S/netgraph
endif
VPATH+= $S/netinet
VPATH+= $S/netinet/libalias
VPATH+= $S/netinet/cc
@ -266,6 +268,7 @@ NET_SRCS+= \
rtsock.c \
slcompress.c
ifdef FF_NETGRAPH
NETGRAPH_SRCS += \
ng_async.c \
ng_atmllc.c \
@ -311,6 +314,7 @@ NETGRAPH_SRCS += \
ng_UI.c \
ng_vjc.c \
ng_vlan.c
endif
NETINET_SRCS+= \
if_ether.c \

View File

@ -1096,6 +1096,7 @@ foffset_lock(struct file *fp, int flags)
*/
mtxp = mtx_pool_find(mtxpool_sleep, fp);
mtx_lock(mtxp);
/*
if ((flags & FOF_NOLOCK) == 0) {
while (fp->f_vnread_flags & FOFFSET_LOCKED) {
fp->f_vnread_flags |= FOFFSET_LOCK_WAITING;
@ -1104,6 +1105,7 @@ foffset_lock(struct file *fp, int flags)
}
fp->f_vnread_flags |= FOFFSET_LOCKED;
}
*/
res = fp->f_offset;
mtx_unlock(mtxp);
return (res);

View File

@ -88,7 +88,7 @@ _sleep(void *ident, struct lock_object *lock, int priority,
const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
{
//FIXME:we couldn't really sleep.
return (0);
return (EPERM);
}