Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / freebsd / openpty.c
blobbfba8ce5784843122522282836f1f6edb6285ddd
1 /* Build with cc -lutil valgrind-ptsname.c */
3 #include <sys/types.h>
4 #include <sys/ioctl.h>
6 #include <unistd.h>
7 #include <termios.h>
9 #include <libutil.h>
12 * ==18203== Syscall param ioctl(generic) points to uninitialised byte(s)
13 * ==18203== at 0x49AAE7A: ioctl (in /lib/libc.so.7)
14 * ==18203== by 0x490C116: fdevname_r (in /lib/libc.so.7)
15 * ==18203== by 0x49E1567: ptsname (in /lib/libc.so.7)
16 * ==18203== by 0x486B5E2: openpty (in /lib/libutil.so.9)
17 * ==18203== by 0x2016E6: main (in /tmp/a.out)
18 * ==18203== Address 0x1ffc000a74 is on thread 1's stack
19 * ==18203== in frame #1, created by fdevname_r (???:)
22 #if 0
23 /* Relevant bit from lib/libc/gen/fdevname.c */
24 char *
25 fdevname_r(int fd, char *buf, int len)
27 struct fiodgname_arg fgn;
30 * buf here points to a `static` buffer in ptsname.c, these are the only
31 * two members of fiodgname_arg.
33 fgn.buf = buf;
34 fgn.len = len;
36 if (_ioctl(fd, FIODGNAME, &fgn) == -1)
37 return (NULL);
38 return (buf);
40 #endif
42 int
43 main()
45 int master, slave;
47 (void)openpty(&master, &slave, NULL, NULL, NULL);
49 return (0);