Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Learn handwriting-how to find the type definition of function parameters in the man manual

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Origin:

Follow the development board to learn Linux, using functions such as chmod, but the experiments in the video are explained in detail. However, if there is no other material to support, just look at the description of man, who knows what these custom types are primitive types?

To take a simple example, chmod:

This mode_t type is obviously redefined. What is its original type?

Step by step:

1) start with the header file sys/stat.h. The path: / usr/include/sys/stat.h is opened as shown below:

2) look inside bits/types.h. The path: / usr/include/bits/types.h is opened as shown below:

3) find _ _ MODE_T_TYPE

I found a piece of code and comments like this.

4) go to the path: / usr/include/bits/typesizes.h

U32_TYPE already seems obvious, unsigned 32-bit type, look further down.

5) return to the path: / usr/include/bits/types.h

Unsigned int unsigned integer, this is the original type of mode_t.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 215

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report