Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#include poll.h instead of sys/poll.h #38140

Merged
merged 1 commit into from
Nov 4, 2020

Conversation

fingolfin
Copy link
Member

@fingolfin fingolfin commented Oct 22, 2020

As far as I know, POSIX always mandated poll.h, and sys/poll.h comes from legacy systems. In any case, to the best of my knowledge on all systems supported by Julia, including poll.h works. In contrast, on FreeBSD including sys/poll.h triggers a warning.

UPDATE: oops for trying to use #include as the first word in a git commit message, not realizing this would be treated as a comment line 😂

@fingolfin fingolfin changed the title As far as I know, POSIX always mandated poll.h, and sys/poll.h comes … #include poll.h instead of sys/poll.h Oct 22, 2020
@fingolfin
Copy link
Member Author

It seems this also fixes a similar warning on musl libc as in FreeBSD.

@vtjnash
Copy link
Member

vtjnash commented Oct 23, 2020

Why do we even add this file, since we don't use it. I suggest:

diff --git a/src/support/timefuncs.c b/src/support/timefuncs.c
index 031967638e..56ea94ef64 100644
--- a/src/support/timefuncs.c
+++ b/src/support/timefuncs.c
@@ -1,25 +1,14 @@
 // This file is a part of Julia. License is MIT: https://julialang.org/license
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
 #include <assert.h>
-#include <errno.h>
-#include <limits.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
 #include "dtypes.h"
 
 #if defined(_OS_WINDOWS_)
-#include <malloc.h>
 #include <sys/timeb.h>
 #include <windows.h>
 #else
 #include <sys/time.h>
-#include <sys/poll.h>
-#include <unistd.h>
+#include <sys/select.h>
 #endif
 
 #include "timefuncs.h"

@fingolfin
Copy link
Member Author

Seems even better to me (assuming it works)!

@fingolfin fingolfin closed this Oct 30, 2020
@fingolfin fingolfin reopened this Oct 30, 2020
@vtjnash
Copy link
Member

vtjnash commented Oct 30, 2020

Do you want to update this PR, or me to push a new one?

As far as I know, POSIX always mandated poll.h, and sys/poll.h comes from
legacy systems. In any case, to the best of my knowledge on all systems
supported by Julia, including poll.h works. In contrast, on FreeBSD including
sys/poll.h triggers a warning.
@fingolfin
Copy link
Member Author

Sorry, forgot about this. Updated now!

@JeffBezanson JeffBezanson merged commit ad9f831 into JuliaLang:master Nov 4, 2020
@fingolfin fingolfin deleted the mh/poll branch November 8, 2020 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants