Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1475947 Details for
Bug 1616038
rt-setup: include enable-netsocket-tstamp-static-key.c
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
daemon to enable timestamp on network sockets
enable-netsocket-tstamp-static-key.c (text/x-csrc), 969 bytes, created by
Marcelo Tosatti
on 2018-08-14 19:12:06 UTC
(
hide
)
Description:
daemon to enable timestamp on network sockets
Filename:
MIME Type:
Creator:
Marcelo Tosatti
Created:
2018-08-14 19:12:06 UTC
Size:
969 bytes
patch
obsolete
>/* > * Open a socket, and enable timestamping on it. > * > * This is to avoid Chrony from changing timestamping > * user count from 0->1 and vice-versa, causing > * static key enable/disable IPIs. > * > */ >#include <sys/types.h> >#include <sys/socket.h> >#include <ifaddrs.h> >#include <linux/errqueue.h> >#include <linux/ethtool.h> >#include <linux/net_tstamp.h> >#include <linux/sockios.h> >#include <net/if.h> >#include <stdio.h> >#include <unistd.h> >#include <stdlib.h> > >int main (void) >{ > int option = SOF_TIMESTAMPING_OPT_TX_SWHW; > int sock_fd; > int ret; > > sock_fd = socket(AF_INET, SOCK_DGRAM, 0); > if (sock_fd < 0) { > printf("Error opening the socket\n"); > return 0; > } > > if (setsockopt(sock_fd, SOL_SOCKET, SO_TIMESTAMP, &option, sizeof (option)) < 0) { > printf("Could not enable timestamping option %x", (unsigned int)option); > close(sock_fd); > return 0; > } > > ret = daemon(0, 0); > > if (ret == -1) { > perror("daemon"); > exit(0); > } > > while (1) { > sleep(1000); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1616038
: 1475947