003 File Manager
Current Path:
/usr/src/contrib/ntp/include
usr
/
src
/
contrib
/
ntp
/
include
/
📁
..
📄
Makefile.am
(1.2 KB)
📄
Makefile.in
(24.68 KB)
📄
README
(157 B)
📄
adjtime.h
(1.96 KB)
📄
ascii.h
(2.78 KB)
📄
audio.h
(283 B)
📄
binio.h
(3.26 KB)
📄
declcond.h
(803 B)
📄
gps.h
(2.84 KB)
📄
hopf6039.h
(3.51 KB)
📄
icom.h
(2.33 KB)
📄
ieee754io.h
(2.94 KB)
📄
intreswork.h
(808 B)
📄
iosignal.h
(1.46 KB)
📁
isc
📄
l_stdlib.h
(4.8 KB)
📄
lib_strbuf.h
(674 B)
📄
libntp.h
(436 B)
📄
libssl_compat.h
(4.25 KB)
📄
mbg_gps166.h
(36.84 KB)
📄
mx4200.h
(2.15 KB)
📄
ntif.h
(2.86 KB)
📄
ntp.h
(33.52 KB)
📄
ntp_assert.h
(2.73 KB)
📄
ntp_calendar.h
(14.99 KB)
📄
ntp_calgps.h
(4.02 KB)
📄
ntp_cmdargs.h
(38 B)
📄
ntp_config.h
(8.33 KB)
📄
ntp_control.h
(5.66 KB)
📄
ntp_crypto.h
(6.61 KB)
📄
ntp_datum.h
(1.07 KB)
📄
ntp_debug.h
(635 B)
📄
ntp_filegen.h
(1.76 KB)
📄
ntp_fp.h
(13.37 KB)
📄
ntp_if.h
(651 B)
📄
ntp_intres.h
(1.77 KB)
📄
ntp_io.h
(1.82 KB)
📄
ntp_keyacc.h
(658 B)
📄
ntp_libopts.h
(330 B)
📄
ntp_lineedit.h
(251 B)
📄
ntp_lists.h
(12.09 KB)
📄
ntp_machine.h
(7.18 KB)
📄
ntp_malloc.h
(1.18 KB)
📄
ntp_md5.h
(1.32 KB)
📄
ntp_net.h
(6.61 KB)
📄
ntp_prio_q.h
(1.93 KB)
📄
ntp_proto.h
(95 B)
📄
ntp_psl.h
(342 B)
📄
ntp_random.h
(402 B)
📄
ntp_refclock.h
(7.81 KB)
📄
ntp_request.h
(30.83 KB)
📄
ntp_rfc2553.h
(8.46 KB)
📄
ntp_select.h
(1.02 KB)
📄
ntp_stdlib.h
(9.83 KB)
📄
ntp_string.h
(708 B)
📄
ntp_syscall.h
(1.17 KB)
📄
ntp_syslog.h
(2.94 KB)
📄
ntp_tty.h
(2.61 KB)
📄
ntp_types.h
(7.21 KB)
📄
ntp_unixtime.h
(1.6 KB)
📄
ntp_worker.h
(5.54 KB)
📄
ntp_workimpl.h
(749 B)
📄
ntpd.h
(20.67 KB)
📄
ntpsim.h
(3.85 KB)
📄
parse.h
(14.58 KB)
📄
parse_conf.h
(2.76 KB)
📄
rc_cmdlength.h
(83 B)
📄
recvbuff.h
(3.84 KB)
📄
refclock_atom.h
(449 B)
📄
refidsmear.h
(89 B)
📄
safecast.h
(1.04 KB)
📄
ssl_applink.c
(2.1 KB)
📄
timepps-SCO.h
(11.67 KB)
📄
timepps-Solaris.h
(13.24 KB)
📄
timepps-SunOS.h
(11.78 KB)
📄
timespecops.h
(4.82 KB)
📄
timetoa.h
(2.62 KB)
📄
timevalops.h
(8.33 KB)
📄
timexsup.h
(1.37 KB)
📄
trimble.h
(8.01 KB)
📄
vint64ops.h
(1.05 KB)
Editing: ntp_worker.h
/* * ntp_worker.h */ #ifndef NTP_WORKER_H #define NTP_WORKER_H #include "ntp_workimpl.h" #ifdef WORKER # if defined(WORK_THREAD) && defined(WORK_PIPE) # ifdef HAVE_SEMAPHORE_H # include <semaphore.h> # endif # endif #include "ntp_stdlib.h" /* #define TEST_BLOCKING_WORKER */ /* ntp_config.c ntp_intres.c */ typedef enum blocking_work_req_tag { BLOCKING_GETNAMEINFO, BLOCKING_GETADDRINFO, } blocking_work_req; typedef void (*blocking_work_callback)(blocking_work_req, void *, size_t, void *); typedef enum blocking_magic_sig_e { BLOCKING_REQ_MAGIC = 0x510c7ecf, BLOCKING_RESP_MAGIC = 0x510c7e54, } blocking_magic_sig; /* * The same header is used for both requests to and responses from * the child. In the child, done_func and context are opaque. */ typedef struct blocking_pipe_header_tag { size_t octets; blocking_magic_sig magic_sig; blocking_work_req rtype; u_int child_idx; blocking_work_callback done_func; void * context; } blocking_pipe_header; # ifdef WORK_THREAD # ifdef SYS_WINNT typedef struct { HANDLE thnd; } thread_type; typedef struct { HANDLE shnd; } sema_type; # else typedef pthread_t thread_type; typedef sem_t sema_type; # endif typedef thread_type *thr_ref; typedef sema_type *sem_ref; # endif /* * */ #if defined(WORK_FORK) typedef struct blocking_child_tag { int reusable; int pid; int req_write_pipe; /* parent */ int resp_read_pipe; void * resp_read_ctx; int req_read_pipe; /* child */ int resp_write_pipe; int ispipe; volatile u_int resp_ready_seen; /* signal/scan */ volatile u_int resp_ready_done; /* consumer/mainloop */ } blocking_child; #elif defined(WORK_THREAD) typedef struct blocking_child_tag { /* * blocking workitems and blocking_responses are * dynamically-sized one-dimensional arrays of pointers to * blocking worker requests and responses. * * IMPORTANT: This structure is shared between threads, and all * access that is not atomic (especially queue operations) must * hold the 'accesslock' semaphore to avoid data races. * * The resource management (thread/semaphore * creation/destruction) functions and functions just testing a * handle are safe because these are only changed by the main * thread when no worker is running on the same data structure. */ int reusable; sem_ref accesslock; /* shared access lock */ thr_ref thread_ref; /* thread 'handle' */ /* the reuest queue */ blocking_pipe_header ** volatile workitems; volatile size_t workitems_alloc; size_t head_workitem; /* parent */ size_t tail_workitem; /* child */ sem_ref workitems_pending; /* signalling */ /* the response queue */ blocking_pipe_header ** volatile responses; volatile size_t responses_alloc; size_t head_response; /* child */ size_t tail_response; /* parent */ /* event handles / sem_t pointers */ sem_ref wake_scheduled_sleep; /* some systems use a pipe for notification, others a semaphore. * Both employ the queue above for the actual data transfer. */ #ifdef WORK_PIPE int resp_read_pipe; /* parent */ int resp_write_pipe; /* child */ int ispipe; void * resp_read_ctx; /* child */ #else sem_ref responses_pending; /* signalling */ #endif volatile u_int resp_ready_seen; /* signal/scan */ volatile u_int resp_ready_done; /* consumer/mainloop */ sema_type sem_table[4]; thread_type thr_table[1]; } blocking_child; #endif /* WORK_THREAD */ /* we need some global tag to indicate any blocking child may be ready: */ extern volatile u_int blocking_child_ready_seen;/* signal/scan */ extern volatile u_int blocking_child_ready_done;/* consumer/mainloop */ extern blocking_child ** blocking_children; extern size_t blocking_children_alloc; extern int worker_per_query; /* boolean */ extern int intres_req_pending; extern u_int available_blocking_child_slot(void); extern int queue_blocking_request(blocking_work_req, void *, size_t, blocking_work_callback, void *); extern int queue_blocking_response(blocking_child *, blocking_pipe_header *, size_t, const blocking_pipe_header *); extern void process_blocking_resp(blocking_child *); extern void harvest_blocking_responses(void); extern int send_blocking_req_internal(blocking_child *, blocking_pipe_header *, void *); extern int send_blocking_resp_internal(blocking_child *, blocking_pipe_header *); extern blocking_pipe_header * receive_blocking_req_internal(blocking_child *); extern blocking_pipe_header * receive_blocking_resp_internal(blocking_child *); extern int blocking_child_common(blocking_child *); extern void exit_worker(int) __attribute__ ((__noreturn__)); extern int worker_sleep(blocking_child *, time_t); extern void worker_idle_timer_fired(void); extern void interrupt_worker_sleep(void); extern int req_child_exit(blocking_child *); #ifndef HAVE_IO_COMPLETION_PORT extern int pipe_socketpair(int fds[2], int *is_pipe); extern void close_all_beyond(int); extern void close_all_except(int); extern void kill_asyncio (int); #endif extern void worker_global_lock(int inOrOut); # ifdef WORK_PIPE typedef void (*addremove_io_fd_func)(int, int, int); extern addremove_io_fd_func addremove_io_fd; # else extern void handle_blocking_resp_sem(void *); typedef void (*addremove_io_semaphore_func)(sem_ref, int); extern addremove_io_semaphore_func addremove_io_semaphore; # endif # ifdef WORK_FORK extern int worker_process; # endif #endif /* WORKER */ #if defined(HAVE_DROPROOT) && defined(WORK_FORK) extern void fork_deferred_worker(void); #else # define fork_deferred_worker() do {} while (0) #endif #endif /* !NTP_WORKER_H */
Upload File
Create Folder