• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/syslog-217.1.4/syslogd.tproj/

Lines Matching defs:global

78 /* global */
79 struct global_s global;
165 global.bsd_out_enabled = 1;
235 /* save modules in global.module array */
237 global.module_count = 2;
239 global.module_count = 6;
241 global.module = (module_t **)calloc(global.module_count, sizeof(module_t *));
242 if (global.module == NULL)
248 global.module[m++] = m_asl;
249 global.module[m++] = m_bsd_in;
251 global.module[m++] = m_bsd_out;
252 global.module[m++] = m_klog_in;
253 global.module[m++] = m_udp_in;
254 global.module[m++] = m_remote;
277 fprintf(fp, "%d\n", global.pid);
289 global.launch_dict = launch_msg(tmp);
292 if (global.launch_dict == NULL)
294 asldebug("%d launchd checkin failed\n", global.pid);
298 tmp = launch_data_dict_lookup(global.launch_dict, LAUNCH_JOBKEY_MACHSERVICES);
301 asldebug("%d launchd lookup of LAUNCH_JOBKEY_MACHSERVICES failed\n", global.pid);
308 asldebug("%d launchd lookup of SERVICE_NAME failed\n", global.pid);
312 global.server_port = launch_data_get_machport(pdict);
315 status = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &(global.dead_session_port));
322 status = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &(global.listen_set));
329 status = mach_port_move_member(mach_task_self(), global.server_port, global.listen_set);
336 status = mach_port_move_member(mach_task_self(), global.dead_session_port, global.listen_set);
347 OSSpinLockLock(&global.lock);
349 global.debug = enable;
350 free(global.debug_file);
351 global.debug_file = NULL;
352 if (path != NULL) global.debug_file = strdup(path);
354 OSSpinLockUnlock(&global.lock);
360 pthread_mutex_lock(global.db_lock);
362 if (global.dbtype & DB_TYPE_FILE)
364 asl_store_close(global.file_db);
365 global.file_db = NULL;
368 if (global.dbtype & DB_TYPE_MEMORY)
370 asl_memory_close(global.memory_db);
371 global.memory_db = NULL;
374 if (global.dbtype & DB_TYPE_MINI)
376 asl_mini_memory_close(global.mini_db);
377 global.mini_db = NULL;
380 global.dbtype = type;
381 global.db_file_max = file_max;
382 global.db_memory_max = memory_max;
383 global.db_mini_max = mini_max;
385 pthread_mutex_unlock(global.db_lock);
408 snprintf(buf, sizeof(buf), "%u", global.pid);
498 memset(&global, 0, sizeof(struct global_s));
500 global.db_lock = (pthread_mutex_t *)calloc(1, sizeof(pthread_mutex_t));
501 pthread_mutex_init(global.db_lock, NULL);
506 global.work_queue = dispatch_queue_create("Work Queue", NULL);
507 dispatch_suspend(global.work_queue);
529 global.dbtype = DB_TYPE_FILE;
530 global.db_file_max = 25600000;
534 global.dbtype = DB_TYPE_FILE;
535 global.db_file_max = 10240000;
540 global.dbtype = DB_TYPE_FILE;
541 global.db_file_max = 25600000;
543 global.dbtype = DB_TYPE_MINI;
555 global.debug = 1;
556 if (((i+1) < argc) && (argv[i+1][0] != '-')) global.debug_file = strdup(argv[++i]);
565 global.dbtype |= DB_TYPE_FILE;
566 if (((i + 1) < argc) && (argv[i+1][0] != '-')) global.db_file_max = atol(argv[++i]);
570 global.dbtype |= DB_TYPE_MEMORY;
571 if (((i + 1) < argc) && (argv[i+1][0] != '-')) global.db_memory_max = atol(argv[++i]);
575 global.dbtype |= DB_TYPE_MINI;
576 if (((i + 1) < argc) && (argv[i+1][0] != '-')) global.db_mini_max = atol(argv[++i]);
582 if ((i + 1) < argc) global.mark_time = 60 * atoll(argv[++i]);
586 if ((i + 1) < argc) global.utmp_ttl = atol(argv[++i]);
590 if ((i + 1) < argc) global.mps_limit = atol(argv[++i]);
594 if ((i + 1) < argc) global.bsd_max_dup_time = atoll(argv[++i]);
612 if ((i + 1) < argc) global.launchd_enabled = atoi(argv[++i]);
626 if (global.dbtype == 0)
628 global.dbtype = DB_TYPE_FILE;
629 global.db_file_max = 25600000;
638 asldebug("\n%s syslogd PID %d starting\n", tstr, global.pid);
657 notify_register_dispatch(kNotifySCNetworkChange, &network_change_token, global.work_queue, ^(int x){
664 global.sig_hup_src = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, (uintptr_t)SIGHUP, 0, dispatch_get_main_queue());
665 dispatch_source_set_event_handler(global.sig_hup_src, ^{
666 dispatch_async(global.work_queue, ^{
670 for (i = 0; i < global.module_count; i++)
672 if (global.module[i]->enabled != 0) global.module[i]->reset();
677 dispatch_resume(global.sig_hup_src);
683 if (global.mark_time > 0)
685 global.mark_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
686 dispatch_source_set_event_handler(global.mark_timer, ^{
689 dispatch_source_set_timer(global.mark_timer, dispatch_time(DISPATCH_TIME_NOW, global.mark_time * NSEC_PER_SEC), global.mark_time * NSEC_PER_SEC, 0);
690 dispatch_resume(global.mark_timer);
718 dispatch_resume(global.work_queue);