Skip to content

x/sys: add BLK* constants (specifically BLKGETSIZE64 and BLKRRPART) #19370

Closed

Description

@stapelberg

I’m about to send the following change for review, adding the BLK* constants which I’m using in a program to re-read the partition table:

--- i/unix/mkerrors.sh
+++ w/unix/mkerrors.sh
@@ -353,7 +353,8 @@ ccflags="$@"
                $2 ~ /^GRND_/ ||
                $2 ~ /^SPLICE_/ ||
                $2 !~ "WMESGLEN" &&
-               $2 ~ /^W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", $2, $2)}
+               $2 ~ /^W[A-Z0-9]+$/ ||
+               $2 ~ /^BLK/ {printf("\t%s = C.%s\n", $2, $2)}
                $2 ~ /^__WCOREFLAG$/ {next}
                $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}

I have a question about the process, though: when running GOARCH=amd64 GOOS=linux ./mkerrors.sh -m64 |gofmt >zerrors_linux_amd64.go I get a significant diff. I’m running the command on a Debian stretch system with linux-libc-dev 4.9.2-2.

Should the command be run on a specific system? If so, which one? Is there documentation about this which I’ve missed?

Activity

  1. ianlancetaylor commented on Mar 2, 2017

    @ianlancetaylor
    Contributor

    Diffs are unfortunately expected, for various historical reasons. The workaround is to run the script and then discard any changes unrelated to what you are doing. At some point we should try to clean this up, but of course that should be independent of any real changes.

  2. bradfitz commented on Mar 2, 2017

    @bradfitz
    Contributor

    Cleaning up the process for regenerating the files is bug #15282.

  3. gopherbot commented on Mar 3, 2017

    @gopherbot
    Contributor

    CL https://golang.org/cl/37640 mentions this issue.

  4. locked and limited conversation to collaborators on Mar 3, 2018
  5. added a commit that references this issue on Jun 7, 2024
    e48874b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions