Skip to contentSkip to conversation

tests/kms-steal-crtc: Include sys/select.h

PATCH Superseded Khem Raj 3 participants 3 messages Dec 30, 2015 – Jan 4, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 tests/kms-steal-crtc: Include sys/select.h

Fixes errors e.g.

error: implicit declaration of function 'select'

and missing definitions of FD_* defines

---
 tests/kms/kms-steal-crtc.c | 1 +
 1 file changed, 1 insertion(+)
tests/kms/kms-steal-crtc.c +1 -0
index 2f7f327..24d70ab 100644
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/select.h>
 
 #include <drm_fourcc.h>
 
Signature · 6 lines
2.6.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Khem Raj

Fixes errors e.g.

error: implicit declaration of function 'select'

and missing definitions of FD_* defines

---
 tests/kms/kms-steal-crtc.c | 1 +
 1 file changed, 1 insertion(+)
tests/kms/kms-steal-crtc.c +0 -0
index 2f7f327..24d70ab 100644

tests/kms/kms-steal-crtc.c line 34

Quoted 4 lines
tests/kms/kms-steal-crtc.c +1 -0
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/select.h>

This must be pulled in some other way on my system, but this looks correct:

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 12 lines · Thierry Reding
Quoted 11 lines · Khem Raj

Fixes errors e.g.

error: implicit declaration of function 'select'

and missing definitions of FD_* defines

---
 tests/kms/kms-steal-crtc.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

tests/kms/kms-steal-crtc.c line 34

Quoted 9 lines
tests/kms/kms-steal-crtc.c +1 -0
index 2f7f327..24d70ab 100644
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/select.h>

This must be pulled in some other way on my system, but this looks correct:

The above header is required/used in compliance with POSIX 2001/2008. Earlier standards use the below three.

#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

I'm not sure how much we should care about platforms non-compliant to POSIX 2001... although adding the header check seems pretty trivial. Add the new one in the list at configure.ac:AC_CHECK_HEADERS and wrap the include in a ifdef guard.

From a quick grep there are a few other users of select()

tests/kms/kms-steal-crtc.c
tests/kms/kms-universal-planes.c
tests/modetest/modetest.c
tests/vbltest/vbltest.c

Raj, can you update the patch to handle the lot (one patch should be ok imho) ?

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel