OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git]
/
libc
/
sysdeps
/
linux
/
sh
/
pipe.c
1
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
}