Skip to content

Commit c2a8903

Browse files
committed
aix: deprecate most lfs routines
add deprecation notices to most routines specified in lfs. this follows from prior commits on lfs. see those for an explanation on why an exception had to be made for two records.
1 parent a0be35f commit c2a8903

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

src/unix/aix/mod.rs

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,10 @@ s! {
455455
__unused: Padding<[*mut c_void; 34]>,
456456
}
457457

458+
#[deprecated(
459+
since = "0.2.187",
460+
note = "Use `rlimit` instead. Their definitions are equivalent."
461+
)]
458462
pub struct rlimit64 {
459463
pub rlim_cur: rlim64_t,
460464
pub rlim_max: rlim64_t,
@@ -478,6 +482,10 @@ s! {
478482
shm_reserved1: Padding<i64>,
479483
}
480484

485+
#[deprecated(
486+
since = "0.2.187",
487+
note = "Use `stat` instead. Their definitions are equivalent."
488+
)]
481489
pub struct stat64 {
482490
pub st_dev: dev_t,
483491
pub st_ino: ino_t,
@@ -2901,25 +2909,63 @@ extern "C" {
29012909
pub fn ffsl(value: c_long) -> c_int;
29022910
pub fn ffsll(value: c_longlong) -> c_int;
29032911
pub fn fgetgrent(file: *mut crate::FILE) -> *mut crate::group;
2912+
#[deprecated(
2913+
since = "0.2.187",
2914+
note = "Use `fgetpos` instead. Their definitions are equivalent."
2915+
)]
2916+
#[allow(deprecated)]
29042917
pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int;
29052918
pub fn fgetpwent(file: *mut crate::FILE) -> *mut passwd;
2919+
#[deprecated(
2920+
since = "0.2.187",
2921+
note = "Use `fopen` instead. Their definitions are equivalent."
2922+
)]
29062923
pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE;
29072924
pub fn freelocale(loc: crate::locale_t);
2925+
#[deprecated(
2926+
since = "0.2.187",
2927+
note = "Use `freopen` instead. Their definitions are equivalent."
2928+
)]
29082929
pub fn freopen64(
29092930
filename: *const c_char,
29102931
mode: *const c_char,
29112932
file: *mut crate::FILE,
29122933
) -> *mut crate::FILE;
2934+
#[deprecated(
2935+
since = "0.2.187",
2936+
note = "Use `fseeko` instead. Their definitions are equivalent."
2937+
)]
2938+
#[allow(deprecated)]
29132939
pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int;
2940+
#[deprecated(
2941+
since = "0.2.187",
2942+
note = "Use `fsetpos` instead. Their definitions are equivalent."
2943+
)]
2944+
#[allow(deprecated)]
29142945
pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int;
2946+
#[deprecated(
2947+
since = "0.2.187",
2948+
note = "Use `fstat` instead. Their definitions are equivalent."
2949+
)]
2950+
#[allow(deprecated)]
29152951
pub fn fstat64(fildes: c_int, buf: *mut stat64) -> c_int;
29162952
pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int;
29172953
#[cfg(aix_large_file_api)]
29182954
pub fn fstatfs64(fd: c_int, buf: *mut statfs64) -> c_int;
29192955
#[cfg(aix_large_file_api)]
29202956
pub fn fstatvfs64(fd: c_int, buf: *mut statvfs64) -> c_int;
2957+
#[deprecated(
2958+
since = "0.2.187",
2959+
note = "Use `ftello` instead. Their definitions are equivalent."
2960+
)]
2961+
#[allow(deprecated)]
29212962
pub fn ftello64(stream: *mut crate::FILE) -> off64_t;
29222963
pub fn ftok(path: *const c_char, id: c_int) -> key_t;
2964+
#[deprecated(
2965+
since = "0.2.187",
2966+
note = "Use `ftruncate` instead. Their definitions are equivalent."
2967+
)]
2968+
#[allow(deprecated)]
29232969
pub fn ftruncate64(fd: c_int, length: off64_t) -> c_int;
29242970
pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
29252971
pub fn getcontext(ucp: *mut ucontext_t) -> c_int;
@@ -2977,6 +3023,11 @@ extern "C" {
29773023
result: *mut *mut passwd,
29783024
) -> c_int;
29793025
pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int;
3026+
#[deprecated(
3027+
since = "0.2.187",
3028+
note = "Use `getrlimit` instead. Their definitions are equivalent."
3029+
)]
3030+
#[allow(deprecated)]
29803031
pub fn getrlimit64(resource: c_int, rlim: *mut rlimit64) -> c_int;
29813032
pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int;
29823033
pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int;
@@ -3028,7 +3079,17 @@ extern "C" {
30283079
width: size_t,
30293080
compar: Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
30303081
) -> *mut c_void;
3082+
#[deprecated(
3083+
since = "0.2.187",
3084+
note = "Use `lseek` instead. Their definitions are equivalent."
3085+
)]
3086+
#[allow(deprecated)]
30313087
pub fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t;
3088+
#[deprecated(
3089+
since = "0.2.187",
3090+
note = "Use `lstat` instead. Their definitions are equivalent."
3091+
)]
3092+
#[allow(deprecated)]
30323093
pub fn lstat64(path: *const c_char, buf: *mut stat64) -> c_int;
30333094
pub fn madvise(addr: caddr_t, len: size_t, advice: c_int) -> c_int;
30343095
pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: c_int, ...);
@@ -3089,6 +3150,10 @@ extern "C" {
30893150
pub fn nl_langinfo(item: nl_item) -> *mut c_char;
30903151
pub fn nl_langinfo_l(item: nl_item, loc: crate::locale_t) -> *mut c_char;
30913152
pub fn nrand48(xseed: *mut c_ushort) -> c_long;
3153+
#[deprecated(
3154+
since = "0.2.187",
3155+
note = "Use `open` instead. Their definitions are equivalent."
3156+
)]
30923157
pub fn open64(path: *const c_char, oflag: c_int, ...) -> c_int;
30933158
pub fn pollset_create(maxfd: c_int) -> pollset_t;
30943159
pub fn pollset_ctl(ps: pollset_t, pollctl_array: *mut poll_ctl, array_length: c_int) -> c_int;
@@ -3102,8 +3167,16 @@ extern "C" {
31023167
pub fn pollset_query(ps: pollset_t, pollfd_query: *mut crate::pollfd) -> c_int;
31033168
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE;
31043169
pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int;
3170+
#[deprecated(
3171+
since = "0.2.187",
3172+
note = "Use `posix_fadvise` instead. Their definitions are equivalent."
3173+
)]
31053174
pub fn posix_fadvise64(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int;
31063175
pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
3176+
#[deprecated(
3177+
since = "0.2.187",
3178+
note = "Use `posix_fallocate` instead. Their definitions are equivalent."
3179+
)]
31073180
pub fn posix_fallocate64(fd: c_int, offset: off_t, len: off_t) -> c_int;
31083181
pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
31093182
pub fn posix_spawn(
@@ -3178,6 +3251,11 @@ extern "C" {
31783251
argv: *const *mut c_char,
31793252
envp: *const *mut c_char,
31803253
) -> c_int;
3254+
#[deprecated(
3255+
since = "0.2.187",
3256+
note = "Use `pread` instead. Their definitions are equivalent."
3257+
)]
3258+
#[allow(deprecated)]
31813259
pub fn pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t;
31823260
pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: offset_t) -> ssize_t;
31833261
pub fn ptrace64(
@@ -3189,6 +3267,11 @@ extern "C" {
31893267
) -> c_int;
31903268
pub fn pututline(u: *const utmp) -> *mut utmp;
31913269
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
3270+
#[deprecated(
3271+
since = "0.2.187",
3272+
note = "Use `pwrite` instead. Their definitions are equivalent."
3273+
)]
3274+
#[allow(deprecated)]
31923275
pub fn pwrite64(fd: c_int, buf: *const c_void, count: size_t, offset: off64_t) -> ssize_t;
31933276
pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: offset_t)
31943277
-> ssize_t;
@@ -3274,6 +3357,10 @@ extern "C" {
32743357
pub fn setpriority(which: c_int, who: id_t, priority: c_int) -> c_int;
32753358
pub fn setpwent();
32763359
pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int;
3360+
#[deprecated(
3361+
since = "0.2.187",
3362+
note = "Use `setrlimit` instead. Their definitions are equivalent."
3363+
)]
32773364
pub fn setrlimit64(resource: c_int, rlim: *const rlimit64) -> c_int;
32783365
pub fn settimeofday(tv: *const crate::timeval, tz: *const timezone) -> c_int;
32793366
pub fn setitimer(
@@ -3301,7 +3388,17 @@ extern "C" {
33013388
pub fn splice(socket1: c_int, socket2: c_int, flags: c_int) -> c_int;
33023389
pub fn srand(seed: c_uint);
33033390
pub fn srand48(seed: c_long);
3391+
#[deprecated(
3392+
since = "0.2.187",
3393+
note = "Use `stat` instead. Their definitions are equivalent."
3394+
)]
3395+
#[allow(deprecated)]
33043396
pub fn stat64(path: *const c_char, buf: *mut stat64) -> c_int;
3397+
#[deprecated(
3398+
since = "0.2.187",
3399+
note = "Use `fstatat` instead. Their definitions are equivalent."
3400+
)]
3401+
#[allow(deprecated)]
33053402
pub fn stat64at(dirfd: c_int, path: *const c_char, buf: *mut stat64, flags: c_int) -> c_int;
33063403
pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int;
33073404
#[cfg(aix_large_file_api)]
@@ -3344,6 +3441,10 @@ extern "C" {
33443441
new_value: *const itimerspec,
33453442
old_value: *mut itimerspec,
33463443
) -> c_int;
3444+
#[deprecated(
3445+
since = "0.2.187",
3446+
note = "Use `truncate` instead. Their definitions are equivalent."
3447+
)]
33473448
pub fn truncate64(path: *const c_char, length: off64_t) -> c_int;
33483449
pub fn uname(buf: *mut utsname) -> c_int;
33493450
pub fn updwtmp(file: *const c_char, u: *const utmp);

0 commit comments

Comments
 (0)