TCP-IP



         

Windows - 3


59 pin->s_addr = rc;

60 return 1;

61 }

62 /* gettimeofday - tselect. */

63 int gettimeofday( struct timeval *tvp, struct timezone *tzp )

64 {

65 struct _timeb tb;

66 _ftime( &tb );

67 if ( tvp )

68 {

69 tvp->tv_sec = tb.time;

70 tvp->tv_usec = tb.millitm * 1000;

71 }

72 if ( tzp )

73 {

74 tzp->tz_minuteswest = tb.timezone;

75 tzp->tz_dsttime = tb.dstflag;

76 }

77 }

78 /* strerror - , Winsock. */

79 char *strerror( int err )

80 {

81 if ( err >= 0 & err < sys_nerr )

82 return sys_errlist[ err ];

83 else if ( err >= MINBSDSOCKERR && err < MAXBSDSOCKERR )

84 return bsdsocketerrs[ err - MINBSDSOCKERR ];

85 else if ( err == WSASYSNOTREADY )

86 return "Network subsystem is unusable";

/* . */

87 else if ( err == WSAVERNOTSUPPORTED )

88 return "This version of Winsock not supported";

/* Winsock . */

89 else if ( err == WSANOTINITIALISED )

90 return "Winsock not initialized";

/* Winsock . */

91 else

92 return "Unknown error";

/* . */

93 }

| | |