aboutsummaryrefslogtreecommitdiffstats
path: root/src/select.c
AgeCommit message (Collapse)AuthorFilesLines
2017-11-13Fix/Update copyright notices; Add SPDX annotationHarald Welte1-0/+3
Let's fix some erroneous/accidential references to wrong license, update copyright information where applicable and introduce a SPDX-License-Identifier to all files. Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
2017-08-12add osmo_fd_setup() convenience function to fill-in osmo_fdHarald Welte1-0/+18
This basically follows the concept of osmo_timer_setup() and allows the caller to fill-in all configurable fields of osmo_fd in one line of code, rather than open-coding it in 5 lines everywhere. Change-Id: I6dbf19ea22fd65302bfc5424c10418d1b7939094
2017-07-13select: Add new osmo_fd_close() functionHarald Welte1-0/+17
This is a convenience helper that will both close a fd, mark it as closed and unregister it from the event loop abstraction. In most cases, you probably actually want to use it instead of manually closing and calling osmo_fd_unregister(). Change-Id: Icd0933eed6a24edde7cdcb378e138897ecc5332c
2017-06-23doxygen: unify use of \file across the boardNeels Hofmeyr1-6/+7
Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
2017-06-23doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr1-7/+7
Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
2017-06-12update/extend doxygen documentationHarald Welte1-3/+2
It's a pity that even with this patch we still are fare away from having the whole API documented. However, at least we have a more solid foundation. Updates not only extend the documentation, but also make sure it is rendered properly in the doxygen HTML. Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
2017-05-17src/select.c: Don't #include <sys/select.h> if it doesn't existHarald Welte1-1/+1
We have to #include <sys/select.h> inside the block protected by HAVE_SYS_SELECT_H, otherwise it will fail on (embedded) builds where that file doesn't exist, such as the arm-none-eabi target on Debian stable and Ubuntu 16.04. Change-Id: I82a2dcbc55b6ee0e914881c5e09b80506c5de4f2
2017-04-04select: Find the highest fd when filling the fd_setsHolger Hans Peter Freyther1-1/+12
Instead of returning maxfd, which is the highest fd ever seen, take the highest we have seen on this iteration. This makes a tiny difference for the osmo-sip-connector and its event loop integration. select.c ignores the return value of this function right now. This was seen while debugging the eventloop integration of the osmo-sip-connector before and after a VTY connection. The fds being polled didn't go down. Change-Id: I1a6d7271273ec08bb511c21b936891bc508843e4
2017-02-07select: add functionality to check socket statePhilipp Maier1-6/+24
osmo_fd_register() is used to register socket file descriptors, after registering a socket, there is no way to test if the socket is still registered or actually registered at all. This commit adds a new function osmo_fd_register_check() that can be used to check in advance, if the socket fd is registered, before performing further operations. Change-Id: I48ec7098d6bba586c81bf0d5c9088108e2c081c6
2016-09-28osmo_select_main(): drop useless call to osmo_timers_check()3G_2016_09Neels Hofmeyr1-2/+0
osmo_timers_check() does nothing more than counting the active timers. It is of no use to count them when not using the return value in any way. Change-Id: I8d35ca90a4c16d6f1c7f9793d663e5479783efed
2016-05-05Update doxygen annotations in libosmocoreHarald Welte1-1/+5
This adds and improves doxygen API descriptions all over libosmocore, reducing the 'white spots' that don't have any documentation.
2016-03-31select: Externalize fd_set filling and dispatchHolger Hans Peter Freyther1-32/+51
To integrate with an external event loop (in this case glib) we need to allow an application to get a filled out fd_set and then dispatch it. osmo_fds and maxfds are static and I decided to keep it that way and instead create two routines to fill the fdset and then one to dispatch the result. The public header file does not include sys/select.h and we can compile the library without select, so I didn't want to require having to include this file, and used void * for the parameter. Mark the routines as inline to avoid a call from the select function. I have confirmed that inlining has an effect on x86 using Debian's gcc-4.9.2-10 compiler
2016-03-19Add new osmo_fd_get_by_fd() functionHarald Welte1-0/+12
This function can be used to obtain the osmo_fd corresponding to a given fd. The latter can be useful when integrating libosmocore main loop with other libraries.
2015-11-12fix FSF address in sources/headersJaroslav Škarvada1-1/+2
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2014-11-14select.c: Add missing #include lines for string.h and sys/select.hHarald Welte1-0/+2
This is needed on Nuttx.
2014-05-15select: Fix english in commentHolger Hans Peter Freyther1-1/+1
2012-04-18doc: Fix the Doxygen section endingsSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-08-17some more doxygen work (include the notion of modules)Harald Welte1-0/+19
2011-06-26merge process.[ch] with application.[ch]Harald Welte1-0/+9
2011-05-07select: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso1-11/+11
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-05-07timer: use namespace prefix osmo_timer*Pablo Neira Ayuso1-4/+4
Summary of changes: s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g
2011-03-23include: reorganize headers file to include/osmocom/[gsm|core]0.2.0Pablo Neira Ayuso1-3/+3
This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2010-10-31select.c: Change license terms from GPLv2 (from ulogd) to GPLv2+Harald Welte1-2/+3
2010-08-06bsc_fd: Add a build option to be able to debug fd list corruptionHolger Hans Peter Freyther1-0/+12
bsc_register_fd on an already registered fd can corrupt the list in a heavy way and make the select end in an infinite loop, this code will workaround the issue and provide a way to set a breakpoint at the right position in the code.
2010-04-11select.c: Make the ugly hacker uglier...0.1.4Holger Hans Peter Freyther1-1/+2
Right now I'm seeing crashes when removing a link and deleting it and I need this hack to make it not crash. We will have to understand if llist_for_each_entry_safe has a bug or if we are doing something bad with the list (anchors not properly initialized).
2010-02-20fix select.c build (config.h)Harald Welte1-0/+2
2010-02-20intial checkin of the libosmocore projectHarald Welte1-0/+128