This is an archive of the discontinued LLVM Phabricator instance.

[libc] Unify lseek implementations
ClosedPublic

Authored by mikhail.ramalho on Aug 30 2023, 7:55 AM.

Details

Summary

In patch D157792, the calls to SYS_llseek/SYS_llseek for 32-bit systems
were fixed in lseek.cpp but there was another implementation in file.cpp
that was missed.

To reduce the code duplication, this patch unifies both call sites to
use a new lseekimpl function.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 30 2023, 7:55 AM
mikhail.ramalho requested review of this revision.Aug 30 2023, 7:55 AM
  • Added assertion to make sure the new code is only used in 32-bit systems
  • rebased
sivachandra added inline comments.Sep 5 2023, 11:02 AM
libc/src/__support/File/lseekImpl.h
1 ↗(On Diff #555349)

This is a Linux implementation so should live in the linux directory.

Moved implementation to linux dir

sivachandra accepted this revision.Sep 5 2023, 12:48 PM
This revision is now accepted and ready to land.Sep 5 2023, 12:48 PM