Our build of ast-ksh.20120911 fails with src/cmd/ksh93/sh/io.c", line
1008: undefined symbol: SOCK_CLOEXEC
I used the patch below to fix the problem, but then ran into the old
bug with shtests: line 307: write to 1 failed [Bad file number].
Now the question is: Is Solaris still going to be supported? Or is
support fading away? I've seen many other opensource projects
abandoning Solaris after Oracle killed Opensolaris...
diff -r -u src/cmd/ksh93/sh/io.c src/cmd/ksh93/sh/io.c
--- src/cmd/ksh93/sh/io.c 2012-09-05 23:53:53.000000000 +0200
+++ src/cmd/ksh93/sh/io.c 2012-09-12 14:06:04.632100936 +0200
@@ -973,13 +973,14 @@
return(0);
}
-#ifndef _lib_accept4
-# define accept4(a,b,c,d) accept(a,b,c)
-#endif
#if SHOPT_COSHELL
int sh_coaccept(Shell_t *shp,int *pv,int out)
{
+#ifdef _lib_accept4
int fd = accept4(pv[0],(struct sockaddr*)0,(socklen_t*)0,SOCK_CLOEXEC);
+#else
+ int fd = accept(pv[0],(struct sockaddr*)0,(socklen_t*)0);
+#endif
sh_close(pv[0]);
pv[0] = -1;
if(fd<0)
@@ -1005,7 +1006,11 @@
int r,port=20000;
struct sockaddr_in sin;
socklen_t slen;
+#ifdef SOCK_CLOEXEC
if ((pv[out] = socket (AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0)) < 0)
+#else
+ if ((pv[out] = socket (AF_INET, SOCK_STREAM, 0)) < 0)
+#endif
errormsg(SH_DICT,ERROR_system(1),e_pipe);
do
{
Irek
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers