comparison src/getloadavg.c @ 7784:fd03010db0c6

Put #include of errno.h and decl of errno before #ifndef HAVE_GETLOADAVG.
author Roland McGrath <roland@gnu.org>
date Sat, 04 Jun 1994 05:24:48 +0000
parents fca72ee8bf94
children fbc29f1ddd08
comparison
equal deleted inserted replaced
7783:96fa8af2fac8 7784:fd03010db0c6
1 /* Get the system load averages. 1 /* Get the system load averages.
2 Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93 2 Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option) 7 the Free Software Foundation; either version 2, or (at your option)
78 #else 78 #else
79 #include "config.h" 79 #include "config.h"
80 #endif 80 #endif
81 #endif 81 #endif
82 82
83
84 /* Exclude all the code except the test program at the end 83 /* Exclude all the code except the test program at the end
85 if the system has its own `getloadavg' function. */ 84 if the system has its own `getloadavg' function.
85
86 The declaration of `errno' is needed by the test program
87 as well as the function itself, so it comes first. */
88
89 #include <errno.h>
90
91 #ifndef errno
92 extern int errno;
93 #endif
86 94
87 #ifndef HAVE_GETLOADAVG 95 #ifndef HAVE_GETLOADAVG
88 96
89 97
90 /* The existing Emacs configuration files define a macro called 98 /* The existing Emacs configuration files define a macro called
329 #ifdef HAVE_UNISTD_H 337 #ifdef HAVE_UNISTD_H
330 #include <unistd.h> 338 #include <unistd.h>
331 #endif 339 #endif
332 340
333 #include <stdio.h> 341 #include <stdio.h>
334 #include <errno.h>
335
336 #ifndef errno
337 extern int errno;
338 #endif
339 342
340 /* LOAD_AVE_TYPE should only get defined if we're going to use the 343 /* LOAD_AVE_TYPE should only get defined if we're going to use the
341 nlist method. */ 344 nlist method. */
342 #if !defined(LOAD_AVE_TYPE) && (defined(BSD) || defined(LDAV_CVT) || defined(KERNEL_FILE) || defined(LDAV_SYMBOL)) 345 #if !defined(LOAD_AVE_TYPE) && (defined(BSD) || defined(LDAV_CVT) || defined(KERNEL_FILE) || defined(LDAV_SYMBOL))
343 #define LOAD_AVE_TYPE double 346 #define LOAD_AVE_TYPE double