Repository: dotnet/runtime
File: src/libraries/System.Private.CoreLib/src/System/IO/File.cs (C#)

Code before:
            FileShare share = FileShare.Read, FileOptions options = FileOptions.None, long preallocationSize = 0)
        {
            Strategies.FileStreamHelpers.ValidateArguments(path, mode, access, share, bufferSize: 0, options, preallocationSize);

            return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize);
        }

        /// <summary>
        /// Opens a handle to the system's null device.
        /// </summary>
        /// <returns>A <see cref="SafeFileHandle"/> to the system's null device.</returns>
        /// <remarks>
        /// <para>
        /// On Windows, this opens a handle to "NUL". On Unix-based systems, this opens a handle to "/dev/null".
        /// </para>
        /// <para>
        /// The null device is a special file that discards all data written to it and provides no data (EOF)
        /// when read from. This is useful for redirecting unwanted output or providing empty input to processes.
        /// </para>
        /// <para>
        /// The returned handle supports both reading and writing. All read operations return 0 (EOF), and all
        /// write operations succeed without storing any data.
        /// </para>
        /// <para>
        /// The returned handle is not inheritable by child processes.
        /// </para>
        /// <para>
        /// For scenarios that don't require raw file handles or descriptors, consider using <see cref="Stream.Null"/> instead.
        /// </para>
        /// </remarks>
        /// <exception cref="IOException">An I/O error occurred while opening the null device.</exception>
        public static SafeFileHandle OpenNullHandle()
        {
            return OpenNullHandleCore();
        }

        // File and Directory UTC APIs treat a DateTimeKind.Unspecified as UTC whereas
        // ToUniversalTime treats this as local.
        internal static DateTimeOffset GetUtcDateTimeOffset(DateTime dateTime)
        {
            if (dateTime.Kind == DateTimeKind.Local)
                dateTime = dateTime.ToUniversalTime();

            return new DateTimeOffset(dateTime.Ticks, default);
        }

        public static void SetCreationTime(string path, DateTime creationTime)
            => FileSystem.SetCreationTime(Path.GetFullPath(path), creationTime, asDirectory: false);

        /// <summary>
        /// Sets the date and time the file or directory was created.

Review comment (suggestion):
The child processes will have an ability to inherit it.

```suggestion
        /// <para>
        /// The returned handle is not created as inheritable.
        /// </para>
```

Code after:
            FileShare share = FileShare.Read, FileOptions options = FileOptions.None, long preallocationSize = 0)
        {
            Strategies.FileStreamHelpers.ValidateArguments(path, mode, access, share, bufferSize: 0, options, preallocationSize);

            return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize);
        }

        /// <summary>
        /// Opens a handle to the system's null device.
        /// </summary>
        /// <returns>A <see cref="SafeFileHandle"/> to the system's null device.</returns>
        /// <remarks>
        /// <para>
        /// On Windows, this opens a handle to "NUL". On Unix-based systems, this opens a handle to "/dev/null".
        /// </para>
        /// <para>
        /// The null device is a special file that discards all data written to it and provides no data (EOF)
        /// when read from. This is useful for redirecting unwanted output or providing empty input to processes.
        /// </para>
        /// <para>
        /// The returned handle supports both reading and writing. All read operations return 0 (EOF), and all
        /// write operations succeed without storing any data.
        /// </para>
        /// <para>
        /// For scenarios that don't require raw file handles or descriptors, consider using <see cref="Stream.Null"/> instead.
        /// </para>
        /// </remarks>
        /// <exception cref="IOException">An I/O error occurred while opening the null device.</exception>
        public static SafeFileHandle OpenNullHandle()
        {
            return SafeFileHandle.Open(NullDevicePath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, FileOptions.None, preallocationSize: 0);
        }

        // File and Directory UTC APIs treat a DateTimeKind.Unspecified as UTC whereas
        // ToUniversalTime treats this as local.
        internal static DateTimeOffset GetUtcDateTimeOffset(DateTime dateTime)
        {
            if (dateTime.Kind == DateTimeKind.Local)
                dateTime = dateTime.ToUniversalTime();

            return new DateTimeOffset(dateTime.Ticks, default);
        }

        public static void SetCreationTime(string path, DateTime creationTime)
            => FileSystem.SetCreationTime(Path.GetFullPath(path), creationTime, asDirectory: false);

        /// <summary>
        /// Sets the date and time the file or directory was created.
        /// </summary>
        /// <param name="fileHandle">
        /// A <see cref="SafeFileHandle" /> to the file or directory for which to set the creation date and time information.