OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [sh/] [pipe.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
 
2
/* Copyright (C) 2001 Lineo, <davidm@lineo.com> */
3
 
4
#include <errno.h>
5
#include <unistd.h>
6
#include <syscall.h>
7
 
8
int pipe(int *fd)
9
{
10
        long __res, __res2;
11
        __asm__ __volatile__ (
12
      "mov              %2,     r3;"
13
      "mov              %3,     r4;"
14
      "trapa    #0x13;"
15
      "mov          r1, %1;"
16
          : "=z" (__res),
17
            "=r" ((long) __res2)
18
          : "r" ((long) __NR_pipe),
19
            "r" ((long) fd)
20
          : "cc", "memory", "r1", "r3", "r4");
21
        if ((unsigned long)(__res) >= (unsigned long)(-125)) {
22
                int __err = -(__res);
23
                errno = __err;
24
                return(-1);
25
        }
26
        fd[0] = __res;
27
        fd[1] = __res2;
28
        return(0);
29
}
30
 
31
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.