Commit 9749a86
committed
Add support for SO_TIMESTAMPNS and SO_TIMESTAMPING socket options
I've tried to pretty much replicate existing code as much as possible.
This commit adds support for two additional timestamp-related socket
options that provide enhanced timestamping capabilities:
- SO_TIMESTAMPNS: Similar to SO_TIMESTAMP but provides nanosecond
precision timestamps using timespec instead of timeval. This is
useful for applications requiring higher precision timing
information.
- SO_TIMESTAMPING: An integer bitmask option that allows fine-grained
control over which timestamp types are enabled (e.g., software
timestamps, hardware timestamps, etc.). This is primarily used for
advanced network monitoring and performance analysis.
Platform compatibility:
- Linux: Full support for both options
- BSD/macOS: Code compiles but options unavailable (guarded by #ifdef)
- Windows: Code compiles but options unavailable
These options are particularly useful for network performance monitoring,
packet capture tools, and applications requiring precise timing
information.1 parent 28a4463 commit 9749a86
File tree
6 files changed
+736
-9
lines changed- erts/emulator/nifs/common
- lib
- common_test/src
- kernel/test
6 files changed
+736
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2324 | 2324 | | |
2325 | 2325 | | |
2326 | 2326 | | |
| 2327 | + | |
| 2328 | + | |
2327 | 2329 | | |
2328 | 2330 | | |
2329 | 2331 | | |
| |||
2347 | 2349 | | |
2348 | 2350 | | |
2349 | 2351 | | |
| 2352 | + | |
2350 | 2353 | | |
2351 | 2354 | | |
2352 | 2355 | | |
| |||
3031 | 3034 | | |
3032 | 3035 | | |
3033 | 3036 | | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
3034 | 3055 | | |
3035 | 3056 | | |
3036 | 3057 | | |
| |||
10986 | 11007 | | |
10987 | 11008 | | |
10988 | 11009 | | |
| 11010 | + | |
| 11011 | + | |
| 11012 | + | |
| 11013 | + | |
| 11014 | + | |
| 11015 | + | |
| 11016 | + | |
| 11017 | + | |
| 11018 | + | |
| 11019 | + | |
| 11020 | + | |
| 11021 | + | |
| 11022 | + | |
| 11023 | + | |
| 11024 | + | |
| 11025 | + | |
| 11026 | + | |
| 11027 | + | |
| 11028 | + | |
| 11029 | + | |
| 11030 | + | |
| 11031 | + | |
| 11032 | + | |
| 11033 | + | |
| 11034 | + | |
| 11035 | + | |
| 11036 | + | |
| 11037 | + | |
| 11038 | + | |
| 11039 | + | |
| 11040 | + | |
| 11041 | + | |
| 11042 | + | |
| 11043 | + | |
10989 | 11044 | | |
10990 | 11045 | | |
10991 | 11046 | | |
| |||
11495 | 11550 | | |
11496 | 11551 | | |
11497 | 11552 | | |
| 11553 | + | |
| 11554 | + | |
| 11555 | + | |
| 11556 | + | |
| 11557 | + | |
| 11558 | + | |
11498 | 11559 | | |
11499 | 11560 | | |
11500 | 11561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
| 595 | + | |
| 596 | + | |
595 | 597 | | |
596 | 598 | | |
597 | 599 | | |
| |||
613 | 615 | | |
614 | 616 | | |
615 | 617 | | |
| 618 | + | |
616 | 619 | | |
617 | 620 | | |
618 | 621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1858 | 1858 | | |
1859 | 1859 | | |
1860 | 1860 | | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
1861 | 1935 | | |
1862 | 1936 | | |
1863 | 1937 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
203 | 209 | | |
204 | 210 | | |
205 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
0 commit comments