Unable to import linux modules in cgo

I am trying to write a commit to add the quota check before syncing folders.

I am learning cgo and golang, so I apologize if my questions is basic. The error says cannot find any of the <linux/ > files. Do I have install them? I was following an example from this repo https://github.com/moby/moby/blob/a70842f9c84f92741877301f33651353eddb44bb/daemon/graphdriver/quota/projectquota.go

Cgo is somewhat tricky. I’m sure we could sort out the error if you showed it, but on the other hand we’re not going to merge a contribution that uses it. The reason is that it makes cross compilation significantly more difficult and also risks memory safety for the whole program.

I would hope that you can get quota information by calling the relevant syscall directly instead of adding a C implementation/wrapper.

Apparently you also need to figure out the path to the “block special device” that backs the filesystem, for the given path we’re interested in. That in itself might not be trivial.

Do you have any articles on finding the path to the block special device? I was hoping for a chill good first issue, but I do not want to give up yet.

Not at all, I just took a quick look at the GETQUOTA stuff. I think the issue might be less chill than first impressions indicated.