Skip to content
Snippets Groups Projects
Commit 2ddf4b2b authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Avoid redundant prototypes for ptsname(3) et al

This is now possible since we now use `AC_USE_SYSTEM_EXTENSIONS`, which
indirectly enables _XOPEN_SOURCE
parent 2a49ad87
No related branches found
No related tags found
No related merge requests found
...@@ -35,25 +35,22 @@ int __hsunix_getpwuid_r(uid_t uid, struct passwd *pw, char *buffer, ...@@ -35,25 +35,22 @@ int __hsunix_getpwuid_r(uid_t uid, struct passwd *pw, char *buffer,
#endif #endif
#ifdef HAVE_PTSNAME #ifdef HAVE_PTSNAME
// I cannot figure out how to make the definitions of the following // On Linux (and others), <stdlib.h> needs to be included while
// functions visible in <stdlib.h> on Linux. But these definitions // `_XOPEN_SOURCE` is already defined. However, GHCs before GHC 8.0
// follow the POSIX specs, and everything links and runs. // didn't do that yet for CApiFFI, so we need this workaround here.
char *__hsunix_ptsname(int fd) char *__hsunix_ptsname(int fd)
{ {
extern char *ptsname(int);
return ptsname(fd); return ptsname(fd);
} }
int __hsunix_grantpt(int fd) int __hsunix_grantpt(int fd)
{ {
extern int grantpt(int);
return grantpt(fd); return grantpt(fd);
} }
int __hsunix_unlockpt(int fd) int __hsunix_unlockpt(int fd)
{ {
extern int unlockpt(int);
return unlockpt(fd); return unlockpt(fd);
} }
#endif #endif
......
...@@ -126,10 +126,6 @@ int __hsunix_getpwuid_r(uid_t, struct passwd *, char *, size_t, ...@@ -126,10 +126,6 @@ int __hsunix_getpwuid_r(uid_t, struct passwd *, char *, size_t,
#endif #endif
#ifdef HAVE_PTSNAME #ifdef HAVE_PTSNAME
// I cannot figure out how to make the definitions of the following
// functions visible in <stdlib.h> on Linux. But these definitions
// follow the POSIX specs, and everything links and runs.
char *__hsunix_ptsname(int fd); char *__hsunix_ptsname(int fd);
int __hsunix_grantpt(int fd); int __hsunix_grantpt(int fd);
int __hsunix_unlockpt(int fd); int __hsunix_unlockpt(int fd);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment