Required by musl-c.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sigaction(SIGALRM, &alrm_act, NULL);
alarm(interval);
- /* Don't buffer data if redirected to a pipe */
- setbuf(stdout, NULL);
-
do {
/* Every device is potentially nonexistent */
set_cifs_nonexistent(cifs_list);
get_localtime(&rectime, 0);
+ /*
+ * Don't buffer data if redirected to a pipe.
+ * Note: With musl-c, the behavior of this function is undefined except
+ * when it is the first operation on the stream.
+ */
+ setbuf(stdout, NULL);
+
/* Get system name, release number and hostname */
__uname(&header);
if (print_gal_header(&rectime, header.sysname, header.release,
int_act.sa_handler = int_handler;
sigaction(SIGINT, &int_act, NULL);
- /* Don't buffer data if redirected to a pipe */
- setbuf(stdout, NULL);
-
do {
/* Every device is potentially nonexistent */
set_devices_nonexistent(dev_list);
get_localtime(&rectime, 0);
+ /*
+ * Don't buffer data if redirected to a pipe.
+ * Note: With musl-c, the behavior of this function is undefined except
+ * when it is the first operation on the stream.
+ */
+ setbuf(stdout, NULL);
+
/* Get system name, release number and hostname */
__uname(&header);
if (print_gal_header(&rectime, header.sysname, header.release,
int curr = 1, dis = 1;
unsigned long lines = rows;
- /* Dont buffer data if redirected to a pipe */
- setbuf(stdout, NULL);
-
/* Read system uptime and CPU stats */
read_uptime(&(uptime_cs[0]));
read_stat_cpu(st_cpu[0], cpu_nr + 1);
/* Get time */
get_localtime(&(mp_tstamp[0]), 0);
+ /*
+ * Don't buffer data if redirected to a pipe.
+ * Note: With musl-c, the behavior of this function is undefined except
+ * when it is the first operation on the stream.
+ */
+ setbuf(stdout, NULL);
+
/* Get system name, release number and hostname */
__uname(&header);
print_gal_header(&(mp_tstamp[0]), header.sysname, header.release,
unsigned long lines = rows;
struct st_pid *plist;
- /* Don't buffer data if redirected to a pipe */
- setbuf(stdout, NULL);
-
/* Read system uptime */
read_uptime(&uptime_cs[0]);
read_stats(0);
/* Get time */
get_localtime(&(ps_tstamp[0]), 0);
+ /*
+ * Don't buffer data if redirected to a pipe.
+ * Note: With musl-c, the behavior of this function is undefined except
+ * when it is the first operation on the stream.
+ */
+ setbuf(stdout, NULL);
+
/* Get system name, release number and hostname */
__uname(&header);
print_gal_header(&(ps_tstamp[0]), header.sysname, header.release,
skip = 1;
}
- /* Don't buffer data if redirected to a pipe */
- setbuf(stdout, NULL);
-
do {
if (tape_new_stats == NULL) {
get_localtime(&rectime, 0);
+ /*
+ * Don't buffer data if redirected to a pipe.
+ * Note: With musl-c, the behavior of this function is undefined except
+ * when it is the first operation on the stream.
+ */
+ setbuf(stdout, NULL);
+
/* Get system name, release number and hostname */
__uname(&header);
if (print_gal_header(&rectime, header.sysname, header.release,