Make sure we include unistd.h for getpid prototypes to fix build
warnings/errors with newer compilers & C libraries.
Doing that for close in openpf highlights these were using the
wrong function -- need to use fclose on FILE*, not close.
These tests pass again with a cris-elf toolchain.
+2021-01-07 Mike Frysinger <vapier@gentoo.org>
+
+ * kill2.c: Include unistd.h.
+ * pipe1.c, sched1.c, sched2.c, sched3.c, sched4.c, sig5.c,
+ sig8.c: Likewise.
+ * openpf1.c (main): Change close to fclose.
+ * openpf2.c: Likewise.
+
2016-01-04 Mike Frysinger <vapier@gentoo.org>
* asm/opterr1.ms: Update expected output.
#include <stdlib.h>
#include <sys/types.h>
#include <signal.h>
+#include <unistd.h>
+
int
main (void)
{
f = fopen (fnam, "rb");
if (f == NULL)
abort ();
- close (f);
+ fclose (f);
/* Cover another execution path. */
if (fopen ("/nonexistent", "rb") != NULL
FILE *f = fopen ("openpf2.c", "rb");
if (f == NULL)
abort ();
- close (f);
+ fclose (f);
printf ("pass\n");
return 0;
}
#include <sys/types.h>
#include <sys/wait.h>
#include <limits.h>
+#include <unistd.h>
int main (void)
{
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
int main (void)
{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
int main (void)
{
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
+#include <unistd.h>
int main (void)
{
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
+#include <unistd.h>
int main (void)
{
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
+#include <unistd.h>
+
int main (void)
{
kill (getpid (), SIGBUS);
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
+#include <unistd.h>
+
int main (void)
{
signal (SIGALRM, SIG_IGN);