]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - include/internal/e_os.h
Copyright year updates
[thirdparty/openssl.git] / include / internal / e_os.h
index 8b0c3a933c65c0ab5006648ef8953800f80ebbd2..003d63e17f2a8cc5efa5b561340ba63d7cb0a066 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -15,7 +15,7 @@
 
 # include <openssl/e_os2.h>
 # include <openssl/crypto.h>
-# include "internal/nelem.h"
+# include "internal/numbers.h"   /* Ensure the definition of SIZE_MAX */
 
 /*
  * <openssl/e_os2.h> contains what we can justify to make visible to the
@@ -143,7 +143,7 @@ static __inline unsigned int _strlen31(const char *str)
 #     undef stdin
 #     undef stdout
 #     undef stderr
-FILE *__iob_func();
+FILE *__iob_func(void);
 #     define stdin  (&__iob_func()[0])
 #     define stdout (&__iob_func()[1])
 #     define stderr (&__iob_func()[2])
@@ -258,6 +258,7 @@ FILE *__iob_func();
 #   endif
 #   define unlink _unlink
 #   define fileno _fileno
+#   define isatty _isatty
 #  endif
 # else
 #  include <strings.h>
@@ -286,50 +287,6 @@ struct servent *getservbyname(const char *name, const char *proto);
 # endif
 /* end vxworks */
 
-/* system-specific variants defining ossl_sleep() */
-#ifdef OPENSSL_SYS_UNIX
-# include <unistd.h>
-static ossl_inline void ossl_sleep(unsigned long millis)
-{
-# ifdef OPENSSL_SYS_VXWORKS
-    struct timespec ts;
-    ts.tv_sec = (long int) (millis / 1000);
-    ts.tv_nsec = (long int) (millis % 1000) * 1000000ul;
-    nanosleep(&ts, NULL);
-# elif defined(__TANDEM)
-#  if !defined(_REENTRANT)
-#   include <cextdecs.h(PROCESS_DELAY_)>
-    /* HPNS does not support usleep for non threaded apps */
-    PROCESS_DELAY_(millis * 1000);
-#  elif defined(_SPT_MODEL_)
-#   include <spthread.h>
-#   include <spt_extensions.h>
-    usleep(millis * 1000);
-#  else
-    usleep(millis * 1000);
-#  endif
-# else
-    usleep(millis * 1000);
-# endif
-}
-#elif defined(_WIN32)
-# include <windows.h>
-static ossl_inline void ossl_sleep(unsigned long millis)
-{
-    Sleep(millis);
-}
-#else
-/* Fallback to a busy wait */
-# include "internal/time.h"
-static ossl_inline void ossl_sleep(unsigned long millis)
-{
-    const OSSL_TIME finish = ossl_time_add(ossl_time_now(), ossl_ms2time(millis));
-
-    while (ossl_time_compare(ossl_time_now(), finish) < 0)
-        /* busy wait */ ;
-}
-#endif /* defined OPENSSL_SYS_UNIX */
-
 /* ----------------------------- HP NonStop -------------------------------- */
 /* Required to support platform variant without getpid() and pid_t. */
 # if defined(__TANDEM) && defined(_GUARDIAN_TARGET)
@@ -339,12 +296,12 @@ static ossl_inline void ossl_sleep(unsigned long millis)
 #  define gethostbyname(name)                gethostbyname((char*)name)
 #  define ioctlsocket(a,b,c)   ioctl(a,b,c)
 #  ifdef NO_GETPID
-inline int nssgetpid();
+inline int nssgetpid(void);
 #   ifndef NSSGETPID_MACRO
 #    define NSSGETPID_MACRO
 #    include <cextdecs.h(PROCESSHANDLE_GETMINE_)>
 #    include <cextdecs.h(PROCESSHANDLE_DECOMPOSE_)>
-       inline int nssgetpid()
+       inline int nssgetpid(void)
        {
          short phandle[10]={0};
          union pseudo_pid {