📄 ntfy_fd_op.c
字号:
#ifndef lint#ifdef sccsstatic char sccsid[] = "@(#)ntfy_fd_op.c 1.1 92/07/30 Copyr 1985 Sun Micro";#endif#endif#include <sys/types.h>/* AND op on two fds */intntfy_fd_cmp_and(a, b)fd_set *a, *b;{ register int i; for( i = 0; i < howmany(FD_SETSIZE, NFDBITS) ; i++) if (a->fds_bits[i] & b->fds_bits[i]) return(1); return(0);}/* OR op on two fds */intntfy_fd_cmp_or(a, b)fd_set *a, *b;{ register int i; for( i = 0; i < howmany(FD_SETSIZE, NFDBITS) ; i++) if (a->fds_bits[i] | b->fds_bits[i]) return(1); return(0);}/* Are any of the bits set */intntfy_fd_anyset(a)fd_set *a;{ register int i; for( i = 0; i < howmany(FD_SETSIZE, NFDBITS) ; i++) if (a->fds_bits[i]) return(1); return(0);}/* Return OR of two fd's */fd_set*ntfy_fd_cpy_or(a, b)fd_set *a, *b;{ register int i; for( i = 0; i < howmany(FD_SETSIZE, NFDBITS) ; i++) a->fds_bits[i] = a->fds_bits[i] | b->fds_bits[i]; return(a);}/* Return AND of two fd's */fd_set*ntfy_fd_cpy_and(a, b)fd_set *a, *b;{ register int i; for( i = 0; i < howmany(FD_SETSIZE, NFDBITS) ; i++) a->fds_bits[i] = a->fds_bits[i] & b->fds_bits[i]; return(a);}/* Return XOR of two fd's */fd_set*ntfy_fd_cpy_xor(a, b)fd_set *a, *b;{ register int i; for( i = 0; i < howmany(FD_SETSIZE, NFDBITS) ; i++) a->fds_bits[i] = a->fds_bits[i] ^ b->fds_bits[i]; return(a);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -