pastebin - collaborative debugging tool
rovema.kpaste.net RSS


linux SO_TXTIME ./net/core/sock.c
Posted by Anonymous on Tue 28th Sep 2021 11:11
raw | new post

  1.   1216  
  2.   1217          case SO_TXTIME:
  3.   1218                  if (optlen != sizeof(struct sock_txtime)) {
  4.   1219                          ret = -EINVAL;
  5.   1220                          break;
  6.   1221                  } else if (copy_from_sockptr(&sk_txtime, optval,
  7.   1222                             sizeof(struct sock_txtime))) {
  8.   1223                          ret = -EFAULT;
  9.   1224                          break;
  10.   1225                  } else if (sk_txtime.flags & ~SOF_TXTIME_FLAGS_MASK) {
  11.   1226                          ret = -EINVAL;
  12.   1227                          break;
  13.   1228                  }
  14.   1229                  /* CLOCK_MONOTONIC is only used by sch_fq, and this packet
  15.   1230                   * scheduler has enough safe guards.
  16.   1231                   */
  17.   1232                  if (sk_txtime.clockid != CLOCK_MONOTONIC &&
  18.   1233                      !ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) {
  19.   1234                          ret = -EPERM;
  20.   1235                          break;
  21.   1236                  }
  22.   1237                  sock_valbool_flag(sk, SOCK_TXTIME, true);
  23.   1238                  sk->sk_clockid = sk_txtime.clockid;
  24.   1239                  sk->sk_txtime_deadline_mode =
  25.   1240                          !!(sk_txtime.flags & SOF_TXTIME_DEADLINE_MODE);

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at