All of lore.kernel.org
 help / color / mirror / Atom feed
* selftests: Testing a write attempt into a full file?
@ 2017-12-03 20:46 ` elfring
  0 siblings, 0 replies; 8+ messages in thread
From: SF Markus Elfring @ 2017-12-03 20:46 UTC (permalink / raw)
  To: kernel-janitors

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@Sonne:~/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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-03 21:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-03 20:46 selftests: Testing a write attempt into a full file? SF Markus Elfring
2017-12-03 20:46 ` SF Markus Elfring
2017-12-03 20:46 ` [Linux-kselftest-mirror] " SF Markus Elfring
2017-12-03 20:46 ` elfring
2017-12-03 21:59 ` walter harms
2017-12-03 21:59   ` walter harms
2017-12-03 21:59   ` [Linux-kselftest-mirror] " walter harms
2017-12-03 21:59   ` wharms

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.