Skip to content

vcgencmd: Make use of more restricted vcio_gencmd node if available#178

Merged
pelwell merged 1 commit intoraspberrypi:masterfrom
popcornmix:vcio_gencmd
May 11, 2026
Merged

vcgencmd: Make use of more restricted vcio_gencmd node if available#178
pelwell merged 1 commit intoraspberrypi:masterfrom
popcornmix:vcio_gencmd

Conversation

@popcornmix
Copy link
Copy Markdown
Contributor

Comment thread vcgencmd/vcgencmd.c Outdated
}
return file_desc;
printf("Can't open device file: %s\n", devices[0]);
printf("Try creating a device file with: sudo mknod %s c %d 0\n", devices[0], MAJOR_NUM);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested mknod line is now even more outdated than it was before. The misc devices all have a major if 10, and with dynamic minor allocation, you can't know which numbers to put in here - delete this line.

Comment thread vcgencmd/vcgencmd.c Outdated
#define DEVICE_FILE_NAME "/dev/vcio"
#define countof(x) (sizeof x/sizeof *x)

#define MAJOR_NUM 100
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to refer to this as a magic number - the kernel driver calls it VCIO_IOC_MAGIC - since it is now divorced from the device major number.

@popcornmix
Copy link
Copy Markdown
Contributor Author

@pelwell updated

@pelwell pelwell merged commit d0397c6 into raspberrypi:master May 11, 2026
@popcornmix popcornmix deleted the vcio_gencmd branch May 11, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants