Solaris 10 compatability
[exim.git] / src / OS / os.c-SunOS5
1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
4
5 /* Copyright (c) University of Cambridge 2016 */
6 /* Copyright (c) Jeremy Harris 2018 */
7 /* See the file NOTICE for conditions of use and distribution. */
8
9 /* Solaris-specific code. This is concatenated onto the generic
10 src/os.c file. */
11
12 #if defined(MISSING_UNSETENV_3) && !defined(COMPILE_UTILITY)
13 # include "setenv.c"
14 #endif
15
16 /* This is missing in Solaris 10, present in Solaris 11.
17 A feature-test would be good. */
18
19 char *
20 strndup(const char * s, size_t n)
21 {
22 char * dest;
23 if (!(dest = malloc(n))) return NULL;
24 return strncpy(dest, s, n);
25 }
26
27 /* End of os.c-SunOS5 */