python / python/cpython

Add `mutate_flag` parameter for `fcntl.fcntl`

Aperta
#140,597 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

extension-modules stdlib topic-IO type-feature
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Feature or enhancement

Proposal:

fcntl.ioctl has a mutate_flag parameter. When set to True, it will pass the arg buffer to the underlying ioctl syscall directly. This is useful for receiving the result which will be written to the arg buffer.

However, fcntl.fcntl doesn't have this parameter, and it only returns bytes as the modified arg buffer. Users need to parse the bytes using the struct module, even if they have a well-defined structure that already implements the write buffer protocol.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dai punti di ingresso fcntl.fcntl e fcntl.ioctl, confrontando il modo in cui ioctl gestisce mutate_flag con il comportamento attuale di fcntl. Controlla i test fcntl esistenti e le aspettative del buffer protocol; il lavoro è completo quando fcntl.fcntl supporta il parametro proposto e i test coprono la ricezione del buffer modificato senza richiedere struct parsing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
operating-systems
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.