File: lin_proc.c

package info (click to toggle)
clif 0.93-9
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 4,228 kB
  • ctags: 3,284
  • sloc: ansic: 31,464; yacc: 5,067; lex: 819; makefile: 383; sh: 48
file content (54 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (7)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <stdio.h>
#include <rpc/rpc.h>
#include "lin.h"

int *
remote_open_1(remote_op_struct)
     remote_o_struct *remote_op_struct;
{
  static int result;
  
  result = open(remote_op_struct->device,remote_op_struct->flags,remote_op_struct->mode); 
  return(&result);
}

int *
remote_close_1(fd)
     int *fd;
{
  static int result;
  

  result = close(*fd);
  return(&result);
}

remote_r_w_struct *
remote_read_1(par)
     remote_r_w_struct *par;
     
{
  static remote_r_w_struct result;
  int i;
  
  result.fd = par->fd;
  result.bytes = par->bytes;
  if(read(result.fd,result.buf,result.bytes) == -1)
    {
      result.bytes = -1;
    }
  
  return(&result);
}

int *
remote_write_1(remote_w_struct)
     remote_r_w_struct *remote_w_struct;
{
  static int result;
  
  result = write(remote_w_struct->fd,remote_w_struct->buf,remote_w_struct->bytes);
      
  return(&result);
}