Home
last modified time | relevance | path

Searched refs:pfh (Results 1 – 25 of 38) sorted by relevance

12

/freebsd/lib/libutil/
H A Dpidfile.c56 static int _pidfile_remove(struct pidfh *pfh, int freeit);
59 pidfile_verify(const struct pidfh *pfh) in pidfile_verify() argument
63 if (pfh == NULL || pfh->pf_fd == -1) in pidfile_verify()
68 if (fstat(pfh->pf_fd, &sb) == -1) in pidfile_verify()
70 if (sb.st_dev != pfh->pf_dev || sb.st_ino != pfh->pf_ino) in pidfile_verify()
125 struct pidfh *pfh; in pidfile_open() local
130 pfh = malloc(sizeof(*pfh)); in pidfile_open()
131 if (pfh == NULL) in pidfile_open()
135 dirlen = snprintf(pfh->pf_dir, sizeof(pfh->pf_dir), in pidfile_open()
137 filenamelen = snprintf(pfh->pf_filename, in pidfile_open()
[all …]
/freebsd/contrib/openbsm/compat/
H A Dpidfile.h51 static int _pidfile_remove(struct pidfh *pfh, int freeit);
54 pidfile_verify(const struct pidfh *pfh) in pidfile_verify() argument
58 if (pfh == NULL || pfh->pf_fd == -1) in pidfile_verify()
63 if (fstat(pfh->pf_fd, &sb) == -1) in pidfile_verify()
65 if (sb.st_dev != pfh->pf_dev || sb.st_ino != pfh->pf_ino) in pidfile_verify()
99 struct pidfh *pfh; in pidfile_open() local
110 pfh = malloc(sizeof(*pfh)); in pidfile_open()
111 if (pfh == NULL) in pidfile_open()
114 len = snprintf(pfh->pf_path, sizeof(pfh->pf_path), in pidfile_open()
116 if (len >= (int)sizeof(pfh->pf_path)) { in pidfile_open()
[all …]
/freebsd/contrib/pf/ftp-proxy/
H A Dfilter.c61 static struct pfctl_handle *pfh = NULL; variable
77 if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, in add_filter()
107 if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) in add_nat()
112 if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, in add_nat()
141 if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) in add_rdr()
145 if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, in add_rdr()
155 if (ioctl(pfctl_fd(pfh), DIOCXCOMMIT, &pft) == -1) in do_commit()
164 if (ioctl(pfctl_fd(pfh), DIOCXROLLBACK, &pft) == -1) in do_rollback()
183 pfh = pfctl_open(PF_DEVICE); in init_filter()
184 if (pfh == NULL) in init_filter()
[all …]
/freebsd/contrib/pf/tftp-proxy/
H A Dfilter.c65 static struct pfctl_handle *pfh = NULL; variable
81 if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, in add_filter()
111 if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) in add_nat()
116 if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, in add_nat()
145 if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) in add_rdr()
149 if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, in add_rdr()
159 if (ioctl(pfctl_fd(pfh), DIOCXCOMMIT, &pft) == -1) in do_commit()
168 if (ioctl(pfctl_fd(pfh), DIOCXROLLBACK, &pft) == -1) in do_rollback()
186 pfh = pfctl_open(PF_DEVICE); in init_filter()
187 if (pfh == NULL) { in init_filter()
[all …]
/freebsd/usr.sbin/bluetooth/btpand/
H A Dtap.c122 chan->pfh = pidfile_open(pidfile, 0600, NULL); in tap_init()
123 if (chan->pfh == NULL) in tap_init()
125 else if (pidfile_write(chan->pfh) < 0) { in tap_init()
127 pidfile_remove(chan->pfh); in tap_init()
128 chan->pfh = NULL; in tap_init()
H A Dchannel.c139 if (chan->pfh != NULL) { in channel_close()
140 pidfile_remove(chan->pfh); in channel_close()
141 chan->pfh = NULL; in channel_close()
H A Dbtpand.h110 struct pidfh *pfh; member
/freebsd/sys/contrib/openzfs/lib/libshare/os/freebsd/
H A Dnfs.c205 struct pidfh *pfh; in nfs_commit_shares() local
209 pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &mountdpid); in nfs_commit_shares()
210 if (pfh != NULL) { in nfs_commit_shares()
212 pidfile_remove(pfh); in nfs_commit_shares()
/freebsd/lib/libutil/tests/
H A Dpidfile_test.c270 struct pidfh *pfh; in test_pidfile_relative() local
278 pfh = pidfile_open(path, 0600, NULL); in test_pidfile_relative()
279 if (pfh == NULL) in test_pidfile_relative()
281 if (pidfile_write(pfh) != 0) in test_pidfile_relative()
293 if (pidfile_close(pfh) != 0) in test_pidfile_relative()
/freebsd/contrib/openbsm/bin/auditdistd/
H A Dauditdistd.c89 struct pidfh *pfh; variable
119 (void)pidfile_close(pfh); in descriptors_cleanup()
548 KEEP_ERRNO((void)pidfile_remove(pfh)); in main_loop()
725 pfh = NULL; in main()
727 pfh = pidfile_open(adcfg->adc_pidfile, 0600, &otherpid); in main()
728 if (pfh == NULL) { in main()
767 KEEP_ERRNO((void)pidfile_remove(pfh)); in main()
775 KEEP_ERRNO((void)pidfile_remove(pfh)); in main()
782 if (pfh != NULL) { in main()
784 if (pidfile_write(pfh) < 0) { in main()
/freebsd/sbin/pfctl/
H A Dpfctl.c147 struct pfctl_handle *pfh = NULL; variable
316 if ((ret = pfctl_startstop(pfh, 1)) != 0) { in pfctl_enable()
339 if ((ret = pfctl_startstop(pfh, 0)) != 0) { in pfctl_disable()
545 if ((ret = pfctl_clear_states_h(pfh, &kill, &killed)) != 0) in pfctl_clear_iface_states()
801 if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) in pfctl_net_kill_states()
807 if ((ret = pfctl_kill_states_h(pfh, &kill, &newkilled)) != 0) in pfctl_net_kill_states()
873 if (pfctl_kill_states_h(pfh, &kill, &newkilled)) in pfctl_gateway_kill_states()
908 if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) in pfctl_label_kill_states()
948 if ((ret = pfctl_kill_states_h(pfh, &kill, &killed)) != 0) in pfctl_id_kill_states()
967 if ((ret = pfctl_get_addrs(pfh, ticket, nr, r_action, anchorname, &mpnr, which)) != 0) { in pfctl_get_pool()
[all …]
H A Dpfctl.h39 extern struct pfctl_handle *pfh;
/freebsd/usr.sbin/watchdogd/
H A Dwatchdogd.c121 struct pidfh *pfh; in main() local
145 pfh = pidfile_open(pidfile, 0600, &otherpid); in main()
146 if (pfh == NULL) { in main()
157 pidfile_remove(pfh); in main()
165 pidfile_write(pfh); in main()
174 pidfile_remove(pfh); in main()
/freebsd/usr.sbin/bsnmpd/modules/snmp_pf/
H A Dpf_snmp.c53 static struct pfctl_handle *pfh; variable
342 if (pfctl_get_limit(pfh, index, &limit)) { in pf_limits()
432 if (ioctl(pfctl_fd(pfh), DIOCGETTIMEOUT, &pt)) { in pf_timeouts()
1175 if (ioctl(pfctl_fd(pfh), DIOCIGETIFACES, &io)) { in pfi_refresh()
1232 if (ioctl(pfctl_fd(pfh), DIOCGETALTQS, &pa)) { in pfq_refresh()
1252 if (ioctl(pfctl_fd(pfh), DIOCGETALTQ, &pa)) { in pfq_refresh()
1288 pfs = pfctl_get_status_h(pfh); in pfs_refresh()
1330 if (ioctl(pfctl_fd(pfh), DIOCRGETTSTATS, &io)) { in pft_refresh()
1397 if (ioctl(pfctl_fd(pfh), DIOCRGETASTATS, &io)) { in pfa_table_addrs()
1465 if (ioctl(pfctl_fd(pfh), DIOCRGETTABLES, &io)) { in pfa_refresh()
[all …]
/freebsd/sbin/hastd/
H A Dhastd.c71 struct pidfh *pfh; variable
135 (void)pidfile_close(pfh); in descriptors_cleanup()
585 (void)pidfile_remove(pfh); in hastd_reload()
586 pfh = newpfh; in hastd_reload()
1129 KEEP_ERRNO((void)pidfile_remove(pfh)); in main_loop()
1252 pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); in main()
1253 if (pfh == NULL) { in main()
1291 KEEP_ERRNO((void)pidfile_remove(pfh)); in main()
1298 KEEP_ERRNO((void)pidfile_remove(pfh)); in main()
1306 KEEP_ERRNO((void)pidfile_remove(pfh)); in main()
[all …]
/freebsd/usr.sbin/rtsold/
H A Drtsold.c104 static struct pidfh *pfh; variable
217 pfh = pidfile_open(pidfilepath, 0644, NULL); in main()
218 if (pfh == NULL) in main()
279 if (pfh != NULL && pidfile_write(pfh) != 0) { in main()
295 if (pfh != NULL) in main()
296 pidfile_remove(pfh); in main()
/freebsd/usr.sbin/cron/cron/
H A Dcron.c49 struct pidfh *pfh; variable
79 pfh = pidfile_open(pidfile, 0600, &otherpid); in open_pidfile()
80 if (pfh == NULL) { in open_pidfile()
129 pidfile_remove(pfh);
138 pidfile_write(pfh);
H A Dglobals.h63 XTRN struct pidfh *pfh; variable
/freebsd/usr.sbin/powerd/
H A Dpowerd.c577 struct pidfh *pfh = NULL;
694 pfh = pidfile_open(pidfile, 0600, &otherpid);
695 if (pfh == NULL) {
704 pidfile_remove(pfh);
708 pidfile_write(pfh);
930 pidfile_remove(pfh);
585 struct pidfh *pfh = NULL; global() local
/freebsd/contrib/pf/authpf/
H A Dauthpf.c59 struct pfctl_handle *pfh;
137 pfh = pfctl_open(PATH_DEVFILE); in main()
138 if (pfh == NULL) { in main()
649 if (ioctl(pfctl_fd(pfh), DIOCGETRULESETS, &prs)) { in remove_stale_rulesets()
662 if (ioctl(pfctl_fd(pfh), DIOCGETRULESET, &prs)) in remove_stale_rulesets()
706 if ((ioctl(pfctl_fd(pfh), DIOCXBEGIN, t) || in recursive_ruleset_purge()
707 ioctl(pfctl_fd(pfh), DIOCXCOMMIT, t)) && in recursive_ruleset_purge()
715 if (ioctl(pfctl_fd(pfh), DIOCGETRULESETS, prs)) { in recursive_ruleset_purge()
724 if (ioctl(pfctl_fd(pfh), DIOCGETRULESET, prs)) in recursive_ruleset_purge()
770 if (asprintf(&fdpath, "/dev/fd/%d", pfctl_fd(pfh)) in change_filter()
60 struct pfctl_handle *pfh; global() variable
[all...]
/freebsd/usr.sbin/uhsoctl/
H A Duhsoctl.c109 struct pidfh *pfh; member
1288 struct pidfh *pfh; in daemonize() local
1293 pfh = pidfile_open(ctx->pidfile, 0600, &opid); in daemonize()
1294 if (pfh == NULL) { in daemonize()
1301 pidfile_remove(pfh); in daemonize()
1305 pidfile_write(pfh); in daemonize()
1306 ctx->pfh = pfh; in daemonize()
1553 pidfile_remove(ctx.pfh); in main()
/freebsd/sbin/devd/
H A Ddevd.cc145 static struct pidfh *pfh; variable
536 pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); in open_pidfile()
537 if (pfh == NULL) { in open_pidfile()
548 pidfile_write(pfh); in write_pidfile()
555 pidfile_close(pfh); in close_pidfile()
562 pidfile_remove(pfh); in remove_pidfile()
/freebsd/tools/tools/net80211/wesside/wesside/
H A Dwesside.c2400 struct pcap_file_header pfh; local
2402 memset(&pfh, 0, sizeof(pfh));
2403 pfh.magic = TCPDUMP_MAGIC;
2404 pfh.version_major = PCAP_VERSION_MAJOR;
2405 pfh.version_minor = PCAP_VERSION_MINOR;
2406 pfh.thiszone = 0;
2407 pfh.sigfigs = 0;
2408 pfh.snaplen = 65535;
2409 pfh.linktype = LINKTYPE_IEEE802_11;
2414 if (write(weplog.fd, &pfh, sizeof(pfh)) != sizeof(pfh))
/freebsd/sbin/ggate/ggated/
H A Dggated.c1036 struct pidfh *pfh; in main() local
1094 pfh = pidfile_open(ggated_pidfile, 0600, &otherpid); in main()
1095 if (pfh == NULL) { in main()
1109 pidfile_write(pfh); in main()
1147 pidfile_remove(pfh); in main()
/freebsd/libexec/tftpd/tests/
H A Dfunctional.c334 struct pidfh *pfh; in setup() local
377 pfh = pidfile_open(pidfile, 0644, NULL); in setup()
378 ATF_REQUIRE_MSG(pfh != NULL, in setup()
380 ATF_REQUIRE_EQ(0, pidfile_write(pfh)); in setup()
381 ATF_REQUIRE_EQ(0, pidfile_close(pfh)); in setup()

12