Bug 238928 - sys/jail.h isn't C++ safe
Summary: sys/jail.h isn't C++ safe
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 12.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-jail (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-01 16:00 UTC by Yuri Victorovich
Modified: 2020-09-04 00:26 UTC (History)
3 users (show)

See Also:


Attachments
jail.cpp (110 bytes, text/plain)
2019-07-01 16:02 UTC, Yuri Victorovich
no flags Details
stat.cpp (72 bytes, text/plain)
2019-07-01 16:02 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2019-07-01 16:00:31 UTC
Attaching C++ testcases jail.cpp and stat.cpp

> $ c++ -c jail.cpp && nm jail.o | grep jail
>                  U _Z4jailP4jail

> $ c++ -c stat.cpp && nm stat.o | grep stat
>                  U stat


jail call is compiled into a symbol as if it us a C++ function, which it is not, and the stat call is compiled fine.
Comment 1 Yuri Victorovich freebsd_committer 2019-07-01 16:02:01 UTC
Created attachment 205469 [details]
jail.cpp
Comment 2 Yuri Victorovich freebsd_committer 2019-07-01 16:02:19 UTC
Created attachment 205470 [details]
stat.cpp
Comment 3 commit-hook freebsd_committer 2020-08-29 22:25:34 UTC
A commit references this bug:

Author: jamie
Date: Sat Aug 29 22:24:42 UTC 2020
New revision: 364970
URL: https://svnweb.freebsd.org/changeset/base/364970

Log:
  Add __BEGIN_DECLS to jail.h to keep C++ happy.

  PR:		238928
  Reported by:	yuri@

Changes:
  head/sys/sys/jail.h
Comment 4 commit-hook freebsd_committer 2020-09-04 00:25:29 UTC
A commit references this bug:

Author: jamie
Date: Fri Sep  4 00:24:32 UTC 2020
New revision: 365321
URL: https://svnweb.freebsd.org/changeset/base/365321

Log:
  MFC r364970:

      Add __BEGIN_DECLS to jail.h to keep C++ happy.

  PR:		238928
  Reported by:	yuri@

Changes:
_U  stable/12/
  stable/12/sys/sys/jail.h