Sys/select.h header file location

I am writing not only sketch file but also in C/C++ which I am trying to compile together with core-firmware (from GitHub) and re-flash the device.

I am following the instructions on GitHub ( and I am able to build and flash the core as-is (no modification to any source code).

When I started adding custom C/C++ code, I came across a dependency (sys/select.h) which I am not able to find in core-firmware, core-common-lib or the ARM-based gcc tool installation recommended by core-firmware README on GitHub.

Is there an alternative header file for this in the world of Spark? I am using OSX Mavericks and following the README instructions of core-firmware.

If anyone have good resources on how to develop C/C++ libraries for Spark, please, thank you in advance!


Good question @mhe.

Depending on what structures, types, and functions you are using from sys/select.h, you may or may not need to port code to get things to work. Many of of individual declarations in sys/select.h are defined in other locations (for example FD_CLR is in core-common-lib/CC3000_Host_Driver/socket.h). So, depending on what you are using, you might be able to omit this #include statement. To dig in deeper, maybe you could look at the sys/select.h from your working codebase to find the things it declares, then grep for usage of these functions within your working codebase…once you know what select.h functions are used, search for their declarations within the 3 Spark Core firmware repos.

I pretty new to embedded C++ so please let me know if this approach doesn’t make sense. Or perhaps others in the community might have an alternate approach.