Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amd64/i386 两种架构下使用的 .PASSWDS 文件是否通用? #24

Closed
IronBlood opened this issue Sep 21, 2014 · 2 comments
Closed

Comments

@IronBlood
Copy link
Member

原先的 .PASSWDS 是 i386 架构下程序生成的。

如果在64位系统下编译不使用 -m32选项,能否直接使用原先的 .PASSWDS 文件?

提示:对比 struct userec 的长度,并分别注册用户,使用 od 来对比

@IronBlood
Copy link
Member Author

#include "bbs.h"

int main() {
    printf("the size of userec is %d\n", sizeof(struct userec));
    return 0;
}
  • 64bit: 480
  • 32bit: 452

@IronBlood
Copy link
Member Author

64 位下 time_t 的长度发生了变化,若替换为 unsigned int,则 64 位下结构体长度和成员变量的偏移量均相同。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant