コード例 #1
0
ファイル: Ring.Submission.cs プロジェクト: tmds/IoUring
 /// <summary>
 /// Adds a timeout to a previously prepared linked item to the Submission Queue without it being submitted.
 /// The actual submission can be deferred to avoid unnecessary memory barriers.
 /// </summary>
 /// <param name="ts">The amount of time after which the timeout should trigger</param>
 /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param>
 /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param>
 /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param>
 /// <exception cref="SubmissionQueueFullException">If no more free space in the Submission Queue is available</exception>
 public void PrepareLinkTimeout(timespec *ts, TimeoutOptions timeoutOptions, ulong userData = 0, SubmissionOption options = SubmissionOption.None)
 {
     if (!TryPrepareLinkTimeout(ts, timeoutOptions, userData, options))
     {
         ThrowSubmissionQueueFullException();
     }
 }
コード例 #2
0
ファイル: Ring.Submission.cs プロジェクト: tmds/IoUring
 /// <summary>
 /// Adds a timeout to the Submission Queue without it being submitted.
 /// The actual submission can be deferred to avoid unnecessary memory barriers.
 /// </summary>
 /// <param name="ts">The amount of time after which the timeout should trigger if less than <paramref name="count"/> submissions completed.</param>
 /// <param name="count">The amount of completed submissions after which the timeout should trigger</param>
 /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param>
 /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param>
 /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param>
 /// <exception cref="SubmissionQueueFullException">If no more free space in the Submission Queue is available</exception>
 public void PrepareTimeout(timespec *ts, uint count = 1, TimeoutOptions timeoutOptions = TimeoutOptions.Relative, ulong userData = 0,
                            SubmissionOption options = SubmissionOption.None)
 {
     if (!TryPrepareTimeout(ts, count, timeoutOptions, userData, options))
     {
         ThrowSubmissionQueueFullException();
     }
 }
コード例 #3
0
 private unsafe int Utimens(path *path, timespec *tv, fuse_file_info *fi)
 {
     try
     {
         Span <timespec> specs = new Span <timespec>(tv, 2);
         return(_fileSystem.UpdateTimestamps(ToSpan(path),
                                             ref MemoryMarshal.GetReference(specs),
                                             ref MemoryMarshal.GetReference(specs.Slice(1)),
                                             ToFileInfo(fi)));
     }
     catch
     {
         return(-EIO);
     }
 }
コード例 #4
0
ファイル: Submission.Generated.cs プロジェクト: tkp1n/IoUring
        /// <summary>
        /// Prepares this Submission Queue Entry as a timeout to a previously prepared linked item.
        /// </summary>
        /// <param name="ts">The amount of time after which the timeout should trigger</param>
        /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param>
        /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param>
        /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param>
        /// <param name="personality">The personality to impersonate for this submission</param>
        public void PrepareLinkTimeout(timespec *ts, TimeoutOptions timeoutOptions = TimeoutOptions.Relative, ulong userData = 0, SubmissionOption options = SubmissionOption.None, ushort personality = 0)
        {
            var sqe = _sqe;

            unchecked
            {
                sqe->opcode        = IORING_OP_LINK_TIMEOUT;
                sqe->flags         = (byte)options;
                sqe->fd            = -1;
                sqe->addr          = (ulong)ts;
                sqe->len           = 1;
                sqe->timeout_flags = (uint)timeoutOptions;
                sqe->user_data     = userData;
                sqe->personality   = personality;
            }
        }
コード例 #5
0
 public static extern unsafe int kevent64(int kq, kevent64_s *changelist, int nchanges, kevent64_s *eventlist, int nevents, uint flags, timespec *timeout);
コード例 #6
0
 public static extern int ppoll(pollfd *fds, ulong_t nfds, timespec *timeout, sigset_t *sigmask);
コード例 #7
0
ファイル: LibC.cs プロジェクト: terrafx/terrafx.interop.libc
 public static extern int clock_gettime(clockid_t __clock_id, [NativeTypeName("struct timespec *")] timespec *__tp);
コード例 #8
0
ファイル: LibC.cs プロジェクト: terrafx/terrafx.interop.libc
 public static extern int nanosleep([NativeTypeName("const struct timespec *")] timespec *__requested_time, [NativeTypeName("struct timespec *")] timespec *__remaining);
コード例 #9
0
 public static void TIMEVAL_TO_TIMESPEC(timeval *tv, timespec *ts)
 {
     (ts)->tv_sec  = (tv)->tv_sec;
     (ts)->tv_nsec = (tv)->tv_usec * (nint)(1000);
 }
コード例 #10
0
 public static extern int pselect(int __nfds, fd_set *__readfds, fd_set *__writefds, fd_set *__exceptfds, [NativeTypeName("const struct timespec *")] timespec *__timeout, [NativeTypeName("const __sigset_t *")] sigset_t *__sigmask);
コード例 #11
0
ファイル: LibC.cs プロジェクト: terrafx/terrafx.interop.libc
 public static extern int sigtimedwait([NativeTypeName("const sigset_t *")] sigset_t *__set, siginfo_t *__info, [NativeTypeName("const struct timespec *")] timespec *__timeout);
コード例 #12
0
ファイル: aio.cs プロジェクト: vbhupathi/Tmds.LibC
        public static int io_getevents(aio_context_t ctx, long_t min_nr, long_t nr, io_event *events, timespec *timeout)
        {
            int rv = (int)syscall(SYS_io_getevents, ctx.ring, min_nr, nr, events, timeout);

            return(rv);
        }
コード例 #13
0
ファイル: stat.cs プロジェクト: seertenedos/Tmds.LibC
 public static extern int utimensat(int dirfd, byte *path, timespec *times, int flags);
コード例 #14
0
ファイル: stat.cs プロジェクト: seertenedos/Tmds.LibC
 public static extern int futimens(int fd, timespec *times);
コード例 #15
0
ファイル: Ring.Submission.cs プロジェクト: tmds/IoUring
 /// <summary>
 /// Attempts to add a timeout to a previously prepared linked item to the Submission Queue without it being submitted.
 /// The actual submission can be deferred to avoid unnecessary memory barriers.
 /// </summary>
 /// <param name="ts">The amount of time after which the timeout should trigger</param>
 /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param>
 /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param>
 /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param>
 /// <returns><code>false</code> if the submission queue is full. <code>true</code> otherwise.</returns>
 public bool TryPrepareLinkTimeout(timespec *ts, TimeoutOptions timeoutOptions = TimeoutOptions.Relative, ulong userData = 0, SubmissionOption options = SubmissionOption.None)
 => TryPrepareReadWrite(IORING_OP_LINK_TIMEOUT, -1, ts, 1, 0, (int)timeoutOptions, userData, options);
コード例 #16
0
ファイル: LibC.cs プロジェクト: terrafx/terrafx.interop.libc
 public static extern int clock_nanosleep(clockid_t __clock_id, int __flags, [NativeTypeName("const struct timespec *")] timespec *__req, [NativeTypeName("struct timespec *")] timespec *__rem);
コード例 #17
0
ファイル: LinuxSocket.cs プロジェクト: UCIS/UCIS.Core
 private static unsafe extern int recvmmsg(int sockfd, mmsghdr *msgvec, UInt32 vlen, int flags, timespec *timeout);
コード例 #18
0
ファイル: LibC.cs プロジェクト: terrafx/terrafx.interop.libc
 public static extern int timespec_get([NativeTypeName("struct timespec *")] timespec *__ts, int __base);
コード例 #19
0
 public static void TIMESPEC_TO_TIMEVAL(timeval *tv, timespec *ts)
 {
     (tv)->tv_sec  = (ts)->tv_sec;
     (tv)->tv_usec = (ts)->tv_nsec / 1000;
 }
コード例 #20
0
 public static extern int sched_rr_get_interval(pid_t pid, timespec *tp);