[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <428c83c2-4752-0fe4-b135-fa23b69dca78@users.sourceforge.net>
Date: Sun, 3 Dec 2017 21:46:55 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-kselftest@...r.kernel.org, Shuah Khan <shuah@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: selftests: Testing a write attempt into a full file?
Hello,
I have constructed another demonstration program.
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *f = fopen("/dev/full", "a");
if (!f)
goto report_failure;
{
int const c = 'X';
if (fputc(c, f) != c)
goto report_failure;
}
return EXIT_SUCCESS;
report_failure:
perror(__func__);
return errno;
}
I got the following result.
elfring@...ne:~/Projekte/selftests> gcc-7 putc_into_full_file1.c && ./a.out; echo $?
0
Does such a simple test example need further software development considerations?
Regards,
Markus
Powered by blists - more mailing lists