### 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
sleep=dict(type='int', default=1),
            msg=dict(type='str'),
        ),
    )
    host = module.params['host']
    timeout = module.params['timeout']
    connect_timeout = module.params['connect_timeout']
    delay = module.params['delay']
    port = module.params['port']
    state = module.params['state']
    path = module.params['path']
    b_path = to_bytes(path, errors='surrogate_or_strict', nonstring='passthru')
    search_regex = module.params['search_regex']
    b_search_regex = to_bytes(search_regex, errors='surrogate_or_strict', nonstring='passthru')
    msg = module.params['msg']
    if search_regex is not None:
        try:
            b_compiled_search_re = re.compile(b_search_regex, re.MULTILINE)
        except re.error as e:
            module.fail_json(msg="Invalid regular expression: %s" % e)
    else:
        b_compiled_search_re = None
    match_groupdict = {}
    match_groups = ()
    if port and path:
        module.fail_json(msg="port and path parameter can not both be passed to wait_for", elapsed=0)
    if path and state == 'stopped':
        module.fail_json(msg="state=stopped should only be used for checking a port in the wait_for module", elapsed=0)
    if path and state == 'drained':
        module.fail_json(msg="state=drained should only be used for checking a port in the wait_for module", elapsed=0)