### Summary

We have an ansible task using `wait_for` module to wait for network device carrier to be up:
```
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```

This no longer works since https://github.com/ansible/ansible/commit/9d4ced1237380051334b54379ff64e45c0341a6d, because `mmap()` is now used instead of `read()`, and it isn't supported by `sysfs` in this case.

Do we really need to use `mmap()`? I imagine it might cause issues with other pseudofilesystems too.

In the meantime, we use a workaround: use grep in a loop instead
```
command:
  cmd: "grep 1 /sys/class/net/{{ device }}/carrier"
timeout: 1
retries: 60
register: carrier
until: carrier is successful
```

### Issue Type

Bug Report

### Component Name

wait_for

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.7]
  config file = None
  configured module search path = ['/Users/rob.muir/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/rob.muir/workspace/trash/build/.env/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/rob.muir/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/rob.muir/workspace/trash/build/.env/bin/ansible
  python version = 3.10.7 (main, Sep 15 2022, 01:50:27) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.0.3
  libyaml = False
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
```


### OS / Environment

Mac OS controller, Centos Stream 9 target

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```
# set device to say, eth0 or whatever is on your computer
wait_for:
  path: "/sys/class/net/{{ device }}/carrier"
  search_regex: "1"
  timeout: 60
```


### Expected Results

Expect wait_for to still work with files in /sys

### Actual Results

```console
The wait_for will fail, only with recent ansible versions, due to the use of mmap()
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
version_added: "1.8"
  sleep:
    description:
      - Number of seconds to sleep between checks.
      - Before Ansible 2.3 this was hardcoded to 1 second.
    type: int
    default: 1
    version_added: "2.3"
  msg:
    description:
      - This overrides the normal error message from a failure to meet the required conditions.
    type: str
    version_added: "2.4"
extends_documentation_fragment: action_common_attributes
attributes:
    check_mode:
        support: none
    diff_mode:
        support: none
    platform:
        platforms: posix
notes:
  - The ability to use search_regex with a port connection was added in Ansible 1.7.
  - Prior to Ansible 2.4, testing for the absence of a directory or UNIX socket did not work correctly.
  - Prior to Ansible 2.4, testing for the presence of a file did not work correctly if the remote user did not have read access to that file.
  - Under some circumstances when using mandatory access control, a path may always be treated as being absent even if it exists, but
    can't be modified or created by the remote user either.
  - When waiting for a path, symbolic links will be followed.  Many other modules that manipulate files do not follow symbolic links,
    so operations on the path using other modules may not work exactly as expected.
seealso: