make vfs & filesystems use failable copying
[minix3.git] / lib / libsys / fkey_ctl.c
blob94ec9478e40389dfa8b25b5bcae82b6fcce66208
1 #include "sysutil.h"
2 #include <string.h>
4 /*===========================================================================*
5 * fkey_ctl *
6 *===========================================================================*/
7 int fkey_ctl(request, fkeys, sfkeys)
8 int request; /* request to perform */
9 int *fkeys; /* bit masks for F1-F12 keys */
10 int *sfkeys; /* bit masks for Shift F1-F12 keys */
12 /* Send a message to the TTY server to request notifications for function
13 * key presses or to disable notifications. Enabling succeeds unless the key
14 * is already bound to another process. Disabling only succeeds if the key is
15 * bound to the current process.
16 */
17 message m;
18 int s;
19 memset(&m, 0, sizeof(m));
20 m.FKEY_REQUEST = request;
21 m.FKEY_FKEYS = (fkeys) ? *fkeys : 0;
22 m.FKEY_SFKEYS = (sfkeys) ? *sfkeys : 0;
23 s = _taskcall(TTY_PROC_NR, TTY_FKEY_CONTROL, &m);
24 if (fkeys) *fkeys = m.FKEY_FKEYS;
25 if (sfkeys) *sfkeys = m.FKEY_SFKEYS;
26 return(s);