projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
make pthread_create return EAGAIN on resource failure, as required by POSIX
[oweals/musl.git]
/
src
/
unistd
/
truncate.c
1
#include <unistd.h>
2
#include "syscall.h"
3
#include "libc.h"
4
5
int truncate(const char *path, off_t length)
6
{
7
if (sizeof(long) == 8)
8
return syscall2(__NR_truncate, (long)path, length);
9
else {
10
union { long long ll; long l[2]; } u = { length };
11
return syscall3(__NR_truncate64, (long)path, u.l[0], u.l[1]);
12
}
13
}
14
15
LFS64(truncate);