2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
24 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
25 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
26 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
27 /*%% $XConsortium: iscntl.c /main/3 1995/10/23 11:36:59 rswiston $ */
29 * Copyright (c) 1988 by Sun Microsystems, Inc.
36 * Generic control function
39 #if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
44 #include "isam_impl.h"
48 * err = iscntl(isfd, args)
52 * iscntl(isfd, ISCNTL_RPCS_TO_SET, tout) - Set timeout for short operations
53 * iscntl(isfd, ISCNTL_RPCL_TO_SET, tout) - Set timeout for long operations
54 * iscntl(isfd, ISCNTL_RPCS_TO_GET) - Get timeout for short operations
55 * iscntl(isfd, ISCNTL_RPCL_TO_GET) - Get timeout for long operations
56 * iscntl(isfd, ISCNTL_TCP_TO_SET) - Set TCP reconnect timeout
57 * iscntl(isfd, ISCNTL_TCP_TO_GET) - Get TCP reconnect timeout
59 * iscntl(isfd, ISCNTL_APPLMAGIC_WRITE, string) - Write application magic
60 * iscntl(isfd, ISCNTL_APPLMAGIC_READ, buf) - Read application magic
62 * iscntl(ALLISFD, ISCNTL_FDLIMIT_SET, n) - Set limit on UNIX fd use
63 * iscntl(ALLISFD, ISCNTL_FDLIMIT_GET) - Set limit on UNIX fd use
65 * oldfunc = iscntl(ALLISFD, ISCNTL_FATAL, func) - Set fatal error handler
66 * int func(msg) - Apllication handler
67 * if 0 is returned, NetISAM will use openlog("NetISAM") and
68 * syslog(ERR_LOG, msg) to log the error.
70 * iscntl(ALLISFD, ISCNTL_MASKSIGNALS, bool) 1 mask, 0 don't mask
72 * iscntl(isfd, ISCNTL_FSYNC) - synchronize a file's in-core state
77 typedef int (* intfunc)();
79 #if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
81 iscntl(int isfd, int func, ...)
84 iscntl(isfd, func, va_alist)
93 #if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
100 case ISCNTL_MASKSIGNALS:
101 ret = _issignals_cntl(va_arg(pvar, int));
105 ret = _isfatal_error_set_func(va_arg(pvar, intfunc));
108 case ISCNTL_FDLIMIT_SET:
109 ret = _watchfd_max_set(va_arg(pvar, int));
112 case ISCNTL_FDLIMIT_GET:
113 ret = _watchfd_max_get();
116 case ISCNTL_APPLMAGIC_WRITE:
117 ret = _isapplmw(isfd, (va_arg(pvar, char *)));
120 case ISCNTL_APPLMAGIC_READ:
121 ret = _isapplmr(isfd, (va_arg(pvar, char *)));
125 ret = _isfsync(isfd);
129 _setiserrno2(EBADARG, '9', '0');