repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git]
/
compiler-rt
/
test
/
sanitizer_common
/
TestCases
/
Linux
/
ptsname.c
blob
8fa1d370129688ce676d380bedea6aebaaa4a4c0
1
// RUN: %clang %s -o %t && %run %t
2
3
#define _GNU_SOURCE
4
#define _XOPEN_SOURCE 600
5
6
#include <assert.h>
7
#include <fcntl.h>
8
#include <stdlib.h>
9
#include <string.h>
10
#include <unistd.h>
11
12
int
main
() {
13
int
pt
=
posix_openpt
(
O_NOCTTY
);
14
if
(
pt
== -
1
)
15
return
0
;
16
char
*
s
=
ptsname
(
pt
);
17
assert
(
s
);
18
assert
(
strstr
(
s
,
"/dev"
));
19
20
char
buff
[
1000
] = {};
21
int
r
=
ptsname_r
(
pt
,
buff
,
sizeof
(
buff
));
22
assert
(!
r
);
23
assert
(
strstr
(
buff
,
"/dev"
));
24
25
close
(
pt
);
26
return
0
;
27
}