tools/testing/selftests/efivarfs/efivarfs.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/efivarfs/efivarfs.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/efivarfs/efivarfs.sh- Extension
.sh- Size
- 7922 bytes
- Lines
- 379
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function cleanupfunction waitstart
Annotated Snippet
cleanup() {
for f in ${p[@]}; do
rm -f ${f}
done
if [ -e $var ]; then
file_cleanup $var
fi
}
trap cleanup exit
waitstart() {
cat ${p[$[$1+3]]} > /dev/null
}
waitpipe() {
echo 1 > ${p[$[$1+3]]}
cat ${p[$1]} > /dev/null
}
endjob() {
echo 1 > ${p[$1]}
wait -n %$1
}
}
test_multiple_zero_size()
{
##
# check for remove on last close, set up three threads all
# holding the variable (one write and two reads) and then
# close them sequentially (waiting for completion) and check
# the state of the variable
##
{ waitpipe 1; echo 1; } > $var 2> /dev/null &
waitstart 1
# zero length file should exist
[ -e $var ] || exit 1
# second and third delayed close
{ waitpipe 2; } < $var &
waitstart 2
{ waitpipe 3; } < $var &
waitstart 3
# close first fd
endjob 1
# var should only be deleted on last close
[ -e $var ] || exit 1
# close second fd
endjob 2
[ -e $var ] || exit 1
# file should go on last close
endjob 3
[ ! -e $var ] || exit 1
}
test_multiple_create()
{
##
# set multiple threads to access the variable but delay
# the final write to check the close of 2 and 3. The
# final write should succeed in creating the variable
##
{ waitpipe 1; printf '\x07\x00\x00\x00\x54'; } > $var &
waitstart 1
[ -e $var -a ! -s $var ] || exit 1
{ waitpipe 2; } < $var &
waitstart 2
{ waitpipe 3; } < $var &
waitstart 3
# close second and third fds
Annotation
- Detected declarations: `function cleanup`, `function waitstart`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.