UnixOperatingSystem.st
changeset 23818 21bbe07f9435
parent 23817 c713774adb32
child 23836 8b734f62058f
equal deleted inserted replaced
23817:c713774adb32 23818:21bbe07f9435
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1988 by Claus Gittinger
     4  COPYRIGHT (c) 1988 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   100 	poolDictionaries:''
   102 	poolDictionaries:''
   101 	privateIn:UnixOperatingSystem
   103 	privateIn:UnixOperatingSystem
   102 !
   104 !
   103 
   105 
   104 !UnixOperatingSystem primitiveDefinitions!
   106 !UnixOperatingSystem primitiveDefinitions!
   105 fs.h"
   107 %{
       
   108 
       
   109 #include "stxOSDefs.h"
   106 
   110 
   107 #if defined(_AIX)
   111 #if defined(_AIX)
   108 # ifndef WANT_REALPATH
   112 # ifndef WANT_REALPATH
   109 #  define WANT_REALPATH
   113 #  define WANT_REALPATH
   110 # endif
   114 # endif
   552 #endif
   556 #endif
   553 
   557 
   554 /*
   558 /*
   555  * some (old ?) systems do not define this ...
   559  * some (old ?) systems do not define this ...
   556  */
   560  */
   557 #if ! !
   561 #if !defined(R_OK) && !defined(_AIX)
       
   562 # define R_OK    4       /* Test for Read permission */
       
   563 # define W_OK    2       /* Test for Write permission */
       
   564 # define X_OK    1       /* Test for eXecute permission */
       
   565 # define F_OK    0       /* Test for existence of File */
       
   566 #endif
       
   567 
       
   568 #define SIGHANDLER_ARG
       
   569 
       
   570 /*
       
   571  * where is the timezone info ?
       
   572  */
       
   573 #ifdef HAS_TM_GMTOFF
       
   574 # define TIMEZONE(tmPtr)       (-((tmPtr)->tm_gmtoff))
       
   575 #else
       
   576 # if defined(HAS_NO_TIMEZONE)
       
   577 #  if defined(HAS_NO_TM_GMTOFF)
       
   578 #   define TIMEZONE(tmPtr)       0
       
   579 #  else
       
   580 #   define TIMEZONE(tmPtr)       (-((tmPtr)->tm_gmtoff))
       
   581 #  endif
       
   582 # else
       
   583 #  if defined(HAS_ALTZONE)
       
   584 #   define TIMEZONE(tmPtr)       ((tmPtr)->tm_isdst == 0 ? timezone : altzone)
       
   585 #  else  /*!HAS_ALTZONE*/
       
   586 #   define TIMEZONE(tmPtr)       ((tmPtr)->tm_isdst == 0 ? timezone : timezone-3600)
       
   587 #  endif /*!HAS_ALTZONE*/
       
   588 # endif
       
   589 #endif
       
   590 #ifndef CONST
       
   591 # ifdef __GNUC__
       
   592 #  define CONST const
       
   593 # else
       
   594 #  define CONST /* nothing */
       
   595 # endif
       
   596 #endif
       
   597 
       
   598 #ifndef        FORK
       
   599 # if defined(HAS_VFORK)
       
   600 #  define     FORK            vfork
       
   601 # else
       
   602 #  define     FORK            fork
       
   603 # endif
       
   604 #endif
       
   605 
       
   606 /*
       
   607  * Socket defines
       
   608  */
       
   609 #include "stxOSDefs.h"
       
   610 
       
   611 #ifdef NET_IF_SUPPORT  /* for mac address of interfaces */
       
   612 
       
   613 # ifndef _NET_IF_H_INCLUDED_
       
   614 #  include <net/if.h>
       
   615 #  define _NET_IF_H_INCLUDED_
       
   616 # endif
       
   617 
       
   618 # ifndef _SYS_IOCTL_H_INCLUDED_
       
   619 #  include <sys/ioctl.h>
       
   620 #  define _SYS_IOCTL_H_INCLUDED_
       
   621 # endif
       
   622 
       
   623 #endif /* NET_IF_SUPPORT */
       
   624 
       
   625 #if defined(TRY_AGAIN) || defined(HOST_NOT_FOUND)
       
   626 # define USE_H_ERRNO
       
   627 #endif
       
   628 
       
   629 #ifdef USE_H_ERRNO
       
   630 # ifndef h_errno
       
   631  extern h_errno;
       
   632 # endif
       
   633 #endif
       
   634 
       
   635 #if (defined(__ELD__) || defined (ELF))
       
   636 # ifndef ELFMAG1
       
   637 #  include <elf.h>
       
   638 # endif
       
   639 #endif
       
   640 
       
   641 %}
       
   642 ! !
   558 
   643 
   559 !UnixOperatingSystem primitiveFunctions!
   644 !UnixOperatingSystem primitiveFunctions!
   560 s' system() is broken in that it does not correctly
   645 %{
       
   646 
       
   647 /*
       
   648  * some systems' system() is broken in that it does not correctly
   561  * handle EINTR and returns failure even though it actually succeeded.
   649  * handle EINTR and returns failure even though it actually succeeded.
   562  * (LINUX is one of them)
   650  * (LINUX is one of them)
   563  * Here is a fixed version. If you encounter EINTR returns from
   651  * Here is a fixed version. If you encounter EINTR returns from
   564  * UnixOperatingSystem>>executeCommand, you ought to define WANT_SYSTEM
   652  * UnixOperatingSystem>>executeCommand, you ought to define WANT_SYSTEM
   565  * in the xxxIntern.h file to get this fixed version.
   653  * in the xxxIntern.h file to get this fixed version.
   602 # ifndef _SYS_TYPES_H_INCLUDED_
   690 # ifndef _SYS_TYPES_H_INCLUDED_
   603 #  include <sys/types.h>
   691 #  include <sys/types.h>
   604 #  define _SYS_TYPES_H_INCLUDED_
   692 #  define _SYS_TYPES_H_INCLUDED_
   605 # endif
   693 # endif
   606 
   694 
   607 # if (! !
   695 # if (!defined(HAVE_GNU_LD) && !defined (__ELF__)) || !defined(LINUX)
       
   696 #  define       __environ       environ
       
   697     extern char **environ;
       
   698 # endif
       
   699 
       
   700 # if !defined (__sigemptyset)
       
   701 #  define      __sigemptyset   sigemptyset
       
   702 # endif
       
   703 # if !defined (__sigaction)
       
   704 #  define      __sigaction     sigaction
       
   705 #  define      __sigaddset     sigaddset
       
   706 #  define      __sigprocmask   sigprocmask
       
   707 #  define      __execve        execve
       
   708 #  define      __wait          wait
       
   709 #  define      __waitpid       waitpid
       
   710 # endif /* ! LINUX */
       
   711 
       
   712 # define      __sigprocmask   sigprocmask
       
   713 # define      __execve        execve
       
   714 
       
   715 # define        SHELL_PATH      "/bin/sh"       /* Path of the shell.  */
       
   716 # define        SHELL_NAME      "sh"            /* Name to give it.  */
       
   717 
       
   718 
       
   719 static int
       
   720 mySystem(const char *line)
       
   721 {
       
   722     int status, save;
       
   723     pid_t pid;
       
   724     struct sigaction sa, intr, quit;
       
   725     sigset_t block, omask;
       
   726 
       
   727     if (line == NULL)
       
   728 	return -1;
       
   729 
       
   730     sa.sa_handler = SIG_IGN;
       
   731     sa.sa_flags = 0;
       
   732     __sigemptyset (&sa.sa_mask);
       
   733 
       
   734     if (__sigaction (SIGINT, &sa, &intr) < 0) {
       
   735 	DPRINTF(("1: errno=%d\n", errno));
       
   736 	return -1;
       
   737     }
       
   738     if (__sigaction (SIGQUIT, &sa, &quit) < 0) {
       
   739 	save = errno;
       
   740 	(void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
       
   741 	errno = save;
       
   742 	DPRINTF(("2: errno=%d\n", errno));
       
   743 	return -1;
       
   744     }
       
   745 
       
   746     __sigemptyset (&block);
       
   747     __sigaddset (&block, SIGCHLD);
       
   748     save = errno;
       
   749     if (__sigprocmask(SIG_BLOCK, &block, &omask) < 0) {
       
   750 	if (errno == ENOSYS)
       
   751 	    errno = save;
       
   752 	else {
       
   753 	    save = errno;
       
   754 	    (void) __sigaction(SIGINT, &intr, (struct sigaction *) NULL);
       
   755 	    (void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL);
       
   756 	    errno = save;
       
   757 	    DPRINTF(("3: errno=%d\n", errno));
       
   758 	    return -1;
       
   759 	}
       
   760     }
       
   761 
       
   762     pid = FORK();
       
   763     if (pid == (pid_t) 0) {
       
   764 	/* Child side.  */
       
   765 	CONST char *new_argv[4];
       
   766 	new_argv[0] = SHELL_NAME;
       
   767 	new_argv[1] = "-c";
       
   768 	new_argv[2] = line;
       
   769 	new_argv[3] = NULL;
       
   770 
       
   771 	/* Restore the signals.  */
       
   772 	(void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
       
   773 	(void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL);
       
   774 	(void) __sigprocmask (SIG_SETMASK, &omask, (sigset_t *) NULL);
       
   775 
       
   776 	/* Exec the shell.  */
       
   777 	(void) __execve (SHELL_PATH, (char *CONST *) new_argv, __environ);
       
   778 	_exit (127);
       
   779     } else {
       
   780 	if (pid < (pid_t) 0) {
       
   781 	    /* The fork failed.  */
       
   782 	    DPRINTF(("4: errno=%d\n", errno));
       
   783 	    status = -1;
       
   784 	} else {
       
   785 	    /* Parent side.  */
       
   786 #ifdef  NO_WAITPID
       
   787 	    pid_t child;
       
   788 
       
   789 	    do {
       
   790 		__BEGIN_INTERRUPTABLE__
       
   791 		child = __wait (&status);
       
   792 		__END_INTERRUPTABLE__
       
   793 		if (child < 0 && errno != EINTR) {
       
   794 		    DPRINTF(("5: errno=%d\n", errno));
       
   795 		    status = -1;
       
   796 		    break;
       
   797 		}
       
   798 	    } while (child != pid);
       
   799 #else
       
   800 	    pid_t child;
       
   801 
       
   802 	    /* claus: the original did not care for EINTR here ... */
       
   803 	    do {
       
   804 		__BEGIN_INTERRUPTABLE__
       
   805 		child = __waitpid (pid, &status, 0);
       
   806 		__END_INTERRUPTABLE__
       
   807 	    } while ((child != pid) && (errno == EINTR));
       
   808 	    if (child != pid) {
       
   809 		DPRINTF(("6: errno=%d\n", errno));
       
   810 		status = -1;
       
   811 	    }
       
   812 #endif /* NO_WAITPID */
       
   813 	}
       
   814     }
       
   815     save = errno;
       
   816     if ((__sigaction (SIGINT, &intr, (struct sigaction *) NULL)
       
   817      | __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL)
       
   818      | __sigprocmask (SIG_SETMASK, &omask, (sigset_t *) NULL)) != 0) {
       
   819 	if (errno == ENOSYS) {
       
   820 	    errno = save;
       
   821 	} else {
       
   822 	    status = -1;
       
   823 	    DPRINTF(("7: errno=%d\n", errno));
       
   824 	}
       
   825     }
       
   826 
       
   827     return status;
       
   828 }
       
   829 #else
       
   830 # define __wait wait
       
   831 #endif /* WANT_SYSTEM */
       
   832 
       
   833 
       
   834 /*
       
   835  * some systems do not have realpath();
       
   836  * the alternative of reading from a 'pwd'-pipe
       
   837  * is way too slow. Here is a realpath for the rest of us.
       
   838  * define WANT_REALPATH in the xxxIntern-file to get it.
       
   839  */
       
   840 
       
   841 #if defined(HAS_REALPATH)
       
   842 # undef WANT_REALPATH
       
   843 #endif
       
   844 #if !defined(HAS_GETWD) && !defined(HAS_GETCWD)
       
   845 # undef WANT_REALPATH
       
   846 #endif
       
   847 
       
   848 #if defined(WANT_REALPATH)
       
   849 
       
   850 # ifndef NULL
       
   851 #  define NULL (char *)0
       
   852 # endif
       
   853 
       
   854 # define MAX_READLINKS 32
       
   855 
       
   856 # ifndef MAXPATHLEN
       
   857 #  define MAXPATHLEN     1024
       
   858 # endif
       
   859 
       
   860 static char *
       
   861 realpath(const char *path, char *resolved_path)
       
   862 {
       
   863 	char copy_path[MAXPATHLEN];
       
   864 	char link_path[MAXPATHLEN];
       
   865 	char *new_path, *max_path, *mallocedPath;
       
   866 	int readlinks = 0;
       
   867 	int n;
       
   868 
       
   869 	if (resolved_path == NULL) {
       
   870 	    mallocedPath = resolved_path = malloc(MAXPATHLEN+1);
       
   871 	}
       
   872 	new_path = resolved_path;
       
   873 
       
   874 	/* Make a copy of the source path since we may need to modify it. */
       
   875 	strcpy(copy_path, path);
       
   876 	path = copy_path;
       
   877 	max_path = copy_path + MAXPATHLEN - 2;
       
   878 	/* If it's a relative pathname use getwd for starters. */
       
   879 	if (*path != '/') {
       
   880 #ifdef HAS_GETCWD
       
   881 		new_path = getcwd(new_path, MAXPATHLEN - 1);
       
   882 #else
       
   883 		new_path = getwd(new_path);
       
   884 #endif
       
   885 		if (new_path == NULL) {
       
   886 		    if (mallocedPath) free(mallocedPath);
       
   887 		    return(NULL);
       
   888 		}
       
   889 
       
   890 		new_path += strlen(new_path);
       
   891 		if (new_path[-1] != '/')
       
   892 			*new_path++ = '/';
       
   893 	}
       
   894 	else {
       
   895 		*new_path++ = '/';
       
   896 		path++;
       
   897 	}
       
   898 	/* Expand each slash-separated pathname component. */
       
   899 	while (*path != '\0') {
       
   900 		/* Ignore stray "/". */
       
   901 		if (*path == '/') {
       
   902 			path++;
       
   903 			continue;
       
   904 		}
       
   905 		if (*path == '.') {
       
   906 			/* Ignore ".". */
       
   907 			if (path[1] == '\0' || path[1] == '/') {
       
   908 				path++;
       
   909 				continue;
       
   910 			}
       
   911 			if (path[1] == '.') {
       
   912 				if (path[2] == '\0' || path[2] == '/') {
       
   913 					path += 2;
       
   914 					/* Ignore ".." at root. */
       
   915 					if (new_path == resolved_path + 1)
       
   916 						continue;
       
   917 					/* Handle ".." by backing up. */
       
   918 					while ((--new_path)[-1] != '/')
       
   919 						;
       
   920 					continue;
       
   921 				}
       
   922 			}
       
   923 		}
       
   924 		/* Safely copy the next pathname component. */
       
   925 		while (*path != '\0' && *path != '/') {
       
   926 			if (path > max_path) {
       
   927 			    if (mallocedPath) free(mallocedPath);
       
   928 			    errno = ENAMETOOLONG;
       
   929 			    return NULL;
       
   930 			}
       
   931 			*new_path++ = *path++;
       
   932 		}
       
   933 #ifdef S_IFLNK
       
   934 		/* Protect against infinite loops. */
       
   935 		if (readlinks++ > MAX_READLINKS) {
       
   936 		    if (mallocedPath) free(mallocedPath);
       
   937 		    errno = ELOOP;
       
   938 		    return NULL;
       
   939 		}
       
   940 		/* See if latest pathname component is a symlink. */
       
   941 		*new_path = '\0';
       
   942 		n = readlink(resolved_path, link_path, MAXPATHLEN - 1);
       
   943 		if (n < 0) {
       
   944 			/* EINVAL means the file exists but isn't a symlink. */
       
   945 			if (errno != EINVAL) {
       
   946 			    if (mallocedPath) free(mallocedPath);
       
   947 			    return NULL;
       
   948 			}
       
   949 		}
       
   950 		else {
       
   951 			/* Note: readlink doesn't add the null byte. */
       
   952 			link_path[n] = '\0';
       
   953 			if (*link_path == '/')
       
   954 				/* Start over for an absolute symlink. */
       
   955 				new_path = resolved_path;
       
   956 			else
       
   957 				/* Otherwise back up over this component. */
       
   958 				while (*(--new_path) != '/')
       
   959 					;
       
   960 			/* Safe sex check. */
       
   961 			if (strlen(path) + n >= MAXPATHLEN) {
       
   962 			    if (mallocedPath) free(mallocedPath);
       
   963 			    errno = ENAMETOOLONG;
       
   964 			    return NULL;
       
   965 			}
       
   966 			/* Insert symlink contents into path. */
       
   967 			strcat(link_path, path);
       
   968 			strcpy(copy_path, link_path);
       
   969 			path = copy_path;
       
   970 		}
       
   971 #endif /* S_IFLNK */
       
   972 		*new_path++ = '/';
       
   973 	}
       
   974 	/* Delete trailing slash but don't whomp a lone slash. */
       
   975 	if (new_path != resolved_path + 1 && new_path[-1] == '/')
       
   976 		new_path--;
       
   977 	/* Make sure it's null terminated. */
       
   978 	*new_path = '\0';
       
   979 	return resolved_path;
       
   980 }
       
   981 # define HAS_REALPATH
       
   982 #endif /* WANT_REALPATH && not HAS_REALPATH */
       
   983 
       
   984 %}
       
   985 ! !
   608 
   986 
   609 !UnixOperatingSystem class methodsFor:'documentation'!
   987 !UnixOperatingSystem class methodsFor:'documentation'!
   610 
   988 
   611 copyright
   989 copyright
   612 "
   990 "
  9314 
  9692 
  9315     "
  9693     "
  9316      Codeset := #'utf8-mac'.
  9694      Codeset := #'utf8-mac'.
  9317      CodesetEncoder := nil.
  9695      CodesetEncoder := nil.
  9318      OperatingSystem getCodesetEncoder
  9696      OperatingSystem getCodesetEncoder
  9319      OperatingSystem encodePath:'äöü'
  9697      OperatingSystem encodePath:'äöü'
  9320     "
  9698     "
  9321 
  9699 
  9322     "Modified: / 23-01-2013 / 10:00:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  9700     "Modified: / 23-01-2013 / 10:00:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  9323     "Modified: / 27-02-2017 / 15:49:32 / stefan"
  9701     "Modified: / 27-02-2017 / 15:49:32 / stefan"
  9324     "Modified: / 09-08-2017 / 23:00:47 / cg"
  9702     "Modified: / 09-08-2017 / 23:00:47 / cg"
 13076      tweaked for a particular system by editing /etc/gai.conf"
 13454      tweaked for a particular system by editing /etc/gai.conf"
 13077 
 13455 
 13078     |result domain type proto encodedHostName|
 13456     |result domain type proto encodedHostName|
 13079 
 13457 
 13080     domainArg notNil ifTrue:[
 13458     domainArg notNil ifTrue:[
 13081         domain := OperatingSystem domainCodeOf:domainArg.
 13459 	domain := OperatingSystem domainCodeOf:domainArg.
 13082     ].
 13460     ].
 13083     typeArg notNil ifTrue:[
 13461     typeArg notNil ifTrue:[
 13084         type := OperatingSystem socketTypeCodeOf:typeArg.
 13462 	type := OperatingSystem socketTypeCodeOf:typeArg.
 13085     ].
 13463     ].
 13086     protoArg notNil ifTrue:[
 13464     protoArg notNil ifTrue:[
 13087         proto := self protocolCodeOf:protoArg.
 13465 	proto := self protocolCodeOf:protoArg.
 13088     ].
 13466     ].
 13089 
 13467 
 13090     hostName isNil ifTrue:[
 13468     hostName isNil ifTrue:[
 13091         encodedHostName := nil.
 13469 	encodedHostName := nil.
 13092     ] ifFalse:[
 13470     ] ifFalse:[
 13093         encodedHostName := hostName utf8Encoded.
 13471 	encodedHostName := hostName utf8Encoded.
 13094     ].
 13472     ].
 13095     (encodedHostName ~~ hostName and:[OperatingSystem getCodeset ~~ #utf8]) ifTrue:[
 13473     (encodedHostName ~~ hostName and:[OperatingSystem getCodeset ~~ #utf8]) ifTrue:[
 13096         "hostName is not plain ASCII - so this is an IDN domain name. Have to ensure, that the locale is UTF-8.
 13474 	"hostName is not plain ASCII - so this is an IDN domain name. Have to ensure, that the locale is UTF-8.
 13097          Block interrupt to not affect other ST/X processes while the locale is changed."
 13475 	 Block interrupt to not affect other ST/X processes while the locale is changed."
 13098         |interruptsBlocked oldLocale|
 13476 	|interruptsBlocked oldLocale|
 13099 
 13477 
 13100         interruptsBlocked := OperatingSystem blockInterrupts.
 13478 	interruptsBlocked := OperatingSystem blockInterrupts.
 13101         oldLocale := OperatingSystem setLocale:#'LC_CTYPE' to:nil.
 13479 	oldLocale := OperatingSystem setLocale:#'LC_CTYPE' to:nil.
 13102         OperatingSystem setLocale:#'LC_CTYPE' to:'en_US.UTF-8'.
 13480 	OperatingSystem setLocale:#'LC_CTYPE' to:'en_US.UTF-8'.
 13103         result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
 13481 	result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
 13104         OperatingSystem setLocale:#'LC_CTYPE' to:oldLocale.
 13482 	OperatingSystem setLocale:#'LC_CTYPE' to:oldLocale.
 13105         interruptsBlocked ifFalse:[
 13483 	interruptsBlocked ifFalse:[
 13106             OperatingSystem unblockInterrupts.
 13484 	    OperatingSystem unblockInterrupts.
 13107         ].
 13485 	].
 13108     ] ifFalse:[
 13486     ] ifFalse:[
 13109         result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
 13487 	result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
 13110     ].
 13488     ].
 13111     result isArray ifFalse:[
 13489     result isArray ifFalse:[
 13112         |request|
 13490 	|request|
 13113         request := SocketAddressInfo new
 13491 	request := SocketAddressInfo new
 13114             domain:domainArg;
 13492 	    domain:domainArg;
 13115             type:typeArg;
 13493 	    type:typeArg;
 13116             protocol:protoArg;
 13494 	    protocol:protoArg;
 13117             canonicalName:hostName;
 13495 	    canonicalName:hostName;
 13118             serviceName:serviceName.
 13496 	    serviceName:serviceName.
 13119         ^ (HostNameLookupError new
 13497 	^ (HostNameLookupError new
 13120                 parameter:result;
 13498 		parameter:result;
 13121                 messageText:' - ', (result printString);
 13499 		messageText:' - ', (result printString);
 13122                 request:request) raiseRequest.
 13500 		request:request) raiseRequest.
 13123     ].
 13501     ].
 13124     1 to:result size do:[:i |
 13502     1 to:result size do:[:i |
 13125         |entry dom info|
 13503 	|entry dom info|
 13126 
 13504 
 13127         entry := result at:i.
 13505 	entry := result at:i.
 13128 
 13506 
 13129         info := SocketAddressInfo new.
 13507 	info := SocketAddressInfo new.
 13130         info
 13508 	info
 13131             flags:(entry at:1);
 13509 	    flags:(entry at:1);
 13132             domain:(dom := OperatingSystem domainSymbolOf:(entry at:2));
 13510 	    domain:(dom := OperatingSystem domainSymbolOf:(entry at:2));
 13133             type:(OperatingSystem socketTypeSymbolOf:(entry at:3));
 13511 	    type:(OperatingSystem socketTypeSymbolOf:(entry at:3));
 13134             protocol:(self protocolSymbolOf:(entry at:4));
 13512 	    protocol:(self protocolSymbolOf:(entry at:4));
 13135             socketAddress:((SocketAddress newDomain:dom) fromBytes:(entry at:5));
 13513 	    socketAddress:((SocketAddress newDomain:dom) fromBytes:(entry at:5));
 13136             canonicalName:(entry at:6).
 13514 	    canonicalName:(entry at:6).
 13137 
 13515 
 13138         result at:i put:info.
 13516 	result at:i put:info.
 13139     ].
 13517     ].
 13140     ^ result.
 13518     ^ result.
 13141 
 13519 
 13142 
 13520 
 13143     "
 13521     "
 13144      self getAddressInfo:'localhost' serviceName:nil
 13522      self getAddressInfo:'localhost' serviceName:nil
 13145             domain:nil type:nil protocol:nil flags:nil
 13523 	    domain:nil type:nil protocol:nil flags:nil
 13146      self getAddressInfo:nil serviceName:22
 13524      self getAddressInfo:nil serviceName:22
 13147             domain:nil type:nil protocol:nil flags:nil
 13525 	    domain:nil type:nil protocol:nil flags:nil
 13148      self getAddressInfo:'' serviceName:22
 13526      self getAddressInfo:'' serviceName:22
 13149             domain:nil type:nil protocol:nil flags:nil
 13527 	    domain:nil type:nil protocol:nil flags:nil
 13150      self getAddressInfo:'localhost' serviceName:nil
 13528      self getAddressInfo:'localhost' serviceName:nil
 13151             domain:nil type:#stream protocol:nil flags:nil
 13529 	    domain:nil type:#stream protocol:nil flags:nil
 13152      self getAddressInfo:'localhost' serviceName:nil
 13530      self getAddressInfo:'localhost' serviceName:nil
 13153             domain:#inet type:#stream protocol:#tcp flags:nil
 13531 	    domain:#inet type:#stream protocol:#tcp flags:nil
 13154      self getAddressInfo:'blurb.exept.de' serviceName:nil
 13532      self getAddressInfo:'blurb.exept.de' serviceName:nil
 13155             domain:#inet type:nil protocol:nil flags:nil
 13533 	    domain:#inet type:nil protocol:nil flags:nil
 13156      self getAddressInfo:'1.2.3.4' serviceName:'bla'
 13534      self getAddressInfo:'1.2.3.4' serviceName:'bla'
 13157             domain:#inet type:nil protocol:nil flags:nil
 13535 	    domain:#inet type:nil protocol:nil flags:nil
 13158      self getAddressInfo:'localhost' serviceName:'echo'
 13536      self getAddressInfo:'localhost' serviceName:'echo'
 13159             domain:#inet type:nil protocol:nil flags:nil
 13537 	    domain:#inet type:nil protocol:nil flags:nil
 13160      self getAddressInfo:nil serviceName:'echo'
 13538      self getAddressInfo:nil serviceName:'echo'
 13161             domain:#inet type:nil protocol:nil flags:nil
 13539 	    domain:#inet type:nil protocol:nil flags:nil
 13162      self getAddressInfo:nil serviceName:nil
 13540      self getAddressInfo:nil serviceName:nil
 13163             domain:#inet type:nil protocol:nil flags:nil
 13541 	    domain:#inet type:nil protocol:nil flags:nil
 13164      self getAddressInfo:'www.google.de' serviceName:80
 13542      self getAddressInfo:'www.google.de' serviceName:80
 13165             domain:nil type:nil protocol:nil flags:nil
 13543 	    domain:nil type:nil protocol:nil flags:nil
 13166      self getAddressInfo:'www.exept.de' serviceName:nil
 13544      self getAddressInfo:'www.exept.de' serviceName:nil
 13167             domain:nil type:nil protocol:nil flags:nil
 13545 	    domain:nil type:nil protocol:nil flags:nil
 13168      self getAddressInfo:'www.exept.de' serviceName:'https'
 13546      self getAddressInfo:'www.exept.de' serviceName:'https'
 13169             domain:#'AF_INET' type:nil protocol:nil flags:nil
 13547 	    domain:#'AF_INET' type:nil protocol:nil flags:nil
 13170      self getAddressInfo:'www.exept.de' serviceName:'https'
       
 13171             domain:#'AF_UNSPEC' type:nil protocol:nil flags:nil
       
 13172      self getAddressInfo:'www.exept.de' serviceName:nil
 13548      self getAddressInfo:'www.exept.de' serviceName:nil
 13173             domain:#'AF_INET6' type:nil protocol:nil flags:nil
 13549 	    domain:#'AF_INET6' type:nil protocol:nil flags:nil
 13174      self getAddressInfo:'www.baden-württemberg.de' serviceName:nil
 13550      self getAddressInfo:'www.baden-württemberg.de' serviceName:nil
 13175             domain:#'AF_INET' type:#stream protocol:nil flags:nil
 13551 	    domain:#'AF_INET' type:#stream protocol:nil flags:nil
 13176      self getAddressInfo:'www.baden-württemberg.de' serviceName:nil
 13552      self getAddressInfo:'www.baden-württemberg.de' serviceName:nil
 13177             domain:#'AF_INET6' type:#stream protocol:nil flags:nil
 13553 	    domain:#'AF_INET6' type:#stream protocol:nil flags:nil
 13178     "
 13554     "
 13179 
       
 13180     "Modified: / 03-03-2019 / 11:23:38 / Claus Gittinger"
       
 13181 !
 13555 !
 13182 
 13556 
 13183 getNameInfo:socketAddress wantHostName:wantHostName wantServiceName:wantServiceName datagram:useDatagram flags:flags
 13557 getNameInfo:socketAddress wantHostName:wantHostName wantServiceName:wantServiceName datagram:useDatagram flags:flags
 13184     "answer an Array containing the hostName and serviceName
 13558     "answer an Array containing the hostName and serviceName
 13185      in socketAddress.
 13559      in socketAddress.