bug-time
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error stream not working in time


From: Ajinkya Rajput
Subject: Error stream not working in time
Date: Tue, 23 Feb 2021 19:56:04 +0530
User-agent: Zoho Mail

Hi,

      Hope you are doing well!

      Below is code in c language:

#include<stdio.h>

int main()
{
int n = 0;
int k = 1 / n;
return k;
}

when we compile with "gcc <filename>.c", we'll see new executable file "a.out" as output.

on running/execution(./a.out) new file, output will be as below

ubuntu@ubuntu:~/temp/c$ ./a.out
Floating point exception (core dumped)

When we use time for same command, we are getting different, is there any way to get same output?
ubuntu@ubuntu:~/temp/c$ /usr/bin/time ./a.out
Command terminated by signal 8
0.00user 0.00system 0:00.10elapsed 0%CPU (0avgtext+0avgdata 940maxresident)k
0inputs+0outputs (0major+53minor)pagefaults 0swaps

if we forwarded time in different file with option provided by time command, then there is nothing in error stream.
ubuntu@ubuntu:~/temp/c$ /usr/bin/time -o time.txt ./a.out
ubuntu@ubuntu:~/temp/c$
 
  Is there way, we can get output as "Floating point exception (core dumped)" in place of nothing or is this bug?


Thanks and Regards,
Ajinkya


reply via email to

[Prev in Thread] Current Thread [Next in Thread]