Skip to content

Set type of F_RDLCK F_WRLCK and F_UNLCK flags to c_short - #5403

Open
LusterSourav wants to merge 1 commit into
rust-lang:mainfrom
LusterSourav:fix-flock-lck-c-short
Open

Set type of F_RDLCK F_WRLCK and F_UNLCK flags to c_short#5403
LusterSourav wants to merge 1 commit into
rust-lang:mainfrom
LusterSourav:fix-flock-lck-c-short

Conversation

@LusterSourav

@LusterSourav LusterSourav commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

These constants are assigned to the l_type field of struct flock, which is declared as a short on every Linux platform. Changing the type from c_int to c_short will likely not break existing programs. It might introduce warnings about no longer needed conversions to c_short though.

SEEK_SET, SEEK_CUR and SEEK_END keep their c_int type, since they are also passed to lseek where an int is required, per the discussion in issue 1619.

Fixes #1619

@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in an Android module

cc @maurer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong size types for struct flock constants

2 participants