aboutsummaryrefslogtreecommitdiff
path: root/sys_reqc.c
blob: 785603265cb0c227416c746ef85b28efda38cfb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 *   file:  sys_reqc.c
 *
 *   This is the MPX system request function which
 *   uses the C gets function.
 */



/*    sys_req   - implements the MPX system request function.
 *
 *    Parameters: number - request number: a device or exit code.
 *                type   - request type: read, write, wait, signal.
 *                s      - address of read/write buffer.
 *                length - address of buffer length variable.
 *
 *    Return value: None
 *
 *    In this module, the only system request allowed is to
 *    read from the console (keyboard).  This is done using
 *    the standard C function gets().
 */


void sys_req(int number, int type, char *s, int *length)
{
    gets(s);                /* Read a string from the keyboard.       */
    *length = strlen(s);    /* Get its length.                        */
}