`fcntl` module provides no access to F_GETLK operation
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 36k
- Merge medio
- 1g 9h
- PR unite (30g)
- 558
Descrizione
Wrapper/access for fcntl(fd, F_GETLK, …)
The fcntl module currently exposes the F_GETLK constant itself, but unfortunately because the types in struct flock are OS and CFLAGS dependent (off_t, pid_t), the operation is hard to work-around with struct.unpack.
Pitch
Exposing F_GETLK is particularly useful to determine if a process that created a lock file or pid file is actually still alive, vs. whether the lock/pid file was left uncleaned from a previous exit/crash/etc. The l_pid field is the most useful, but if wrapping the call anyway it might make more sense to just expose all values.
I've already implemented this, a PR is following shortly.
Linked PRs
- gh-112372
- gh-96695
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la costante F_GETLK già presente nel modulo fcntl ed esamina i tipi struct flock dipendenti dalla piattaforma descritti nell'issue. Controlla le PR collegate gh-112372 e gh-96695 prima di iniziare, poiché l'implementazione richiesta è già stata segnalata come completata. Il lavoro è completato quando l'accesso a F_GETLK è esposto senza richiedere ai chiamanti di indovinare layout dipendenti dal sistema operativo e da CFLAGS.
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
- 20/100