Declare some functions already exported by msys DLL

Charles Wilson <[email protected]>
Newsgroups gmane.comp.gnu.mingw.msys
Message-ID <[email protected]>
The following functions are already exported by msys-1.0.dll, but are
not declared in the installed header files.  The attached patch should
fix that; and silences some compile warnings when building msys-inetutils.

FYI, the following is still true:

*** Microsoft Vista and above ***
  The r* clients will not operate correctly on this platform.  This is
  because the underlying 'rcmd()' (actually, "cygwin_rcmd()") function
  used by these applications is implemented on MSYS in terms of the
  winsock 'rcmd()' function in wsock32.dll.  However, with the release
  of Microsoft Vista, these important functions:
     rcmd() / rexec() / rresvport()
  are no longer provided by wsock32.dll -- in fact, they are not
  provided at all.  Newer cygwin implementations (since 2006-07-12)
  have (re)implemented rcmd() and friends without relying the missing
  winsock2 functions.  However, MSYS (as of 1.0.13) has not done so;
  until that happens, the r* commands will remain non-functional on
  Vista clients.


Now, these msys-exported rcmd()/rexec()/rresvport() functions DO work
just fine if you're on XP or earlier.  So, since we provide them, and
they work (on some platforms), we should declare them in the installed
headers.

Fixing their operation, on Vista and above, is a project for another patch.

newlib/ChangeLog.MSYS:

2010.03.29  Charles Wilson  <xxx>

	* libc/include/sys/unistd.h: Declare fchdir and getdomainname.

winsup/cygwin/ChangeLog.MSYS:

2010.03.29  Charles Wilson  <xxx>

	* include/netdb.h: Declare rcmd, rexec, and rresvport.

OK?

--
Chuck

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
Mingw-msys mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-msys
msys-headers.patch (application/x-patch, 1.9 KB)
Index: newlib/libc/include/sys/unistd.h
===================================================================
RCS file: /cvsroot/mingw/msys/rt/src/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.3
diff -u -p -r1.3 unistd.h
--- newlib/libc/include/sys/unistd.h	15 Oct 2001 22:22:32 -0000	1.3
+++ newlib/libc/include/sys/unistd.h	30 Mar 2010 03:24:06 -0000
@@ -36,11 +36,17 @@ int     _EXFUN(execv, (const char *__pat
 int     _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] ));
 int     _EXFUN(execvp, (const char *__file, char * const __argv[] ));
 int     _EXFUN(fchmod, (int __fildes, mode_t __mode ));
+#if defined(__CYGWIN__) || defined(__MSYS__) || defined(__rtems__) || defined(__SPU__)
+int     _EXFUN(fchdir, (int __fildes));
+#endif
 int     _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group ));
 pid_t   _EXFUN(fork, (void ));
 long    _EXFUN(fpathconf, (int __fd, int __name ));
 int     _EXFUN(fsync, (int __fd));
 char    _EXFUN(*getcwd, (char *__buf, size_t __size ));
+#if defined(__CYGWIN__) || defined(__MSYS__)
+int     _EXFUN(getdomainname ,(char *__name, size_t __len));
+#endif
 gid_t   _EXFUN(getegid, (void ));
 uid_t   _EXFUN(geteuid, (void ));
 gid_t   _EXFUN(getgid, (void ));
Index: winsup/cygwin/include/netdb.h
===================================================================
RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/include/netdb.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 netdb.h
--- winsup/cygwin/include/netdb.h	7 Aug 2001 17:51:15 -0000	1.1.1.1
+++ winsup/cygwin/include/netdb.h	30 Mar 2010 03:24:06 -0000
@@ -158,6 +158,10 @@ void		setnetent (int);
 void		setprotoent (int);
 void		setservent (int);
 void		setrpcent (int);
+int		rcmd (char **, unsigned short, const char *, const char *,
+		      const char *, int *);
+int		rexec (char **, unsigned short, char *, char *, char *, int *);
+int		rresvport (int *);
 #endif
 
 #ifdef __cplusplus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.